general cleanup, PEP8 and docstring updates