added chapter 07 code from mwd book