Updated code to v8 and fixed syntax errors (flake8)