chapter 5: exercise 6