Tidied up docstrings and comments