finally finished the chapter 9 examples