Added Comments to code

Cleaned up code and added comments