Completed exercise 7 of chapter 4.