add missing import
remove unused imports
use python logging library instead of print statements