Add sample code for chapter 3.