added chapter 02 code form mwd book