Exercise 13.5 from chapter 13