Modified to pass flake8 tests.