cleanup, and pep8 fixes