Finished chapter 2 example