started coding for chapter 3