Completed exercise 4 of chapter 3.