More tidying
Cleaned up comments and docstrings