Revised according to PEP8

W391
Revised according to PEP8

A lot of warings and errors
Additionally removed ``import os`` according to pyflakes