Added comments and cleaned up code. Ready to send to the class