pep8 cleanup + unit tests