Final submission 1.0

This is the cleaned up code with proper comments added to the code.