PEP-8 fixes
Code cleanup and pythonization