Started to add the code for chapter 3