fixed chapter 3 code
Merge pull request #27 from jacobthill/chaptercode

fixed chapter 3 code