flake8 cleanup; add some comments