Exercise 13.4 from chapter 13