Completed exercise 4 of chapter 4.