Add code for Chapter 2, Exercise 1