Pep8 and code tidy