pep8 formatting and adding some docstrings