Cleaned up code and added documentation.

Removed padding around parentheses for uniformity.
Added documentation to methods which were missing it.