removed unused imports, renamed internal variable

flake8 is rather useful for such things...