Cleaned up docstrings and code.