Chapter 12.4 example code.