Completed exercise 6 of chapter 4.