Finish exercise 10 of chapter 6