fix most of the pyflakes warnings