Finished Exercise 1.17.