Kevin Shih’s exercise 6.3