Example 4.2 from Section 4.4 - unmodified
my notes