fixing syntax errors introduced when making code pep-8 compatible