Added docs and corrected style issues.