fixes #175, fix flake8 erros