Code from the guide on page 46.
