answering exercise 2 in chapter 6