Completed exercise 8 of chapter 4.