Finish exercise 7 of chapter 6