Fleshing out code for Part 4 of Tutorial. Not documented.