Added comments / cleaned up the top - end of main part of the code.
Completed commenting of the code.

The code should now be complete enough for Assignment 1.