Exercise 16.1 from chapter 16