Code for Section 2.

Code discussed in Section 2 of the tutorial.