Improved docstrings. Tidied up.