Kevin Shih’s exercise 4.3