add code for chapter 10