PEP8 fixes and docstrings