Completed exercise 3 of chapter 3.