Exercise 13.07 from chapter 13