This change implements the assignment.

The stub functions have been filled out and
comments added that explain their function.