Final source for assignment 2

This is the source that will be submitted for assignment 2.  It has been
updated with comments for readability.