Finish Exercise 2 in Chapter 3