Chapter 2 exercise

Code for chapter 2 added to this branch. Pretty simple stuff, hope I'm using git correctly though.