Comments added to all code

Comments added
Inline documentation written