clean up and adding python3 compatibility imports.