Added Chapter 2 code