Example 2.8, unmodified
my notes
start working on my own solution to Figure 2.9, without peeking