chapter 3 source code.