Completed exercise 8 of chapter 5.