Updated code to be flake8 compatible