The example code from http://examples.oreilly.com/9780596005900/