Finish Exercise 2.31