Kevin Shih’s exercise 5.3