code more like pep8 (still missing/incorrect docstrings)