Completed exercise 5 of chapter 4.