Attempt to increase consistency in code and fixing several pep8 violations