Code from the tutorial on page 112.
