improvements and pep8