Source code for chapter 2 application