Exercise 13.10 from chapter 13