added @tuturto sugesstions and flake8 errors