added chapter 08 code from mwd book