Comments

Added documentation to the majority of the code.