fix pep8 and syntax errors