Chapter 7 example code.