pep8ify code and fix some typos