Added more code for chapter 1