Added Inline Documentation

Clarified some functions and cleaned up other documentation