Cleanup of Code

Cleaning up the code and comments