Added license boilerplate and fixed flake8 errors.