fixing up chapter 9 examples