style improvements and pep8