PEP8 and formatting, docstring improvements