This is pretty much a direct copy of the example code in the book, without any tweaks by me.  I'm along for the ride on this one...