Completed exercise 6 of chapter 5.