Chapter 2 source code.