Tidying: docstrings, comments, whitespace.