Work-along for code in "Understanding Computation" by Tom Stuart