pep8 and pyflakes applied

I didn't do anything with line length yet.