took out all python 3 stuff, and cleaned up code a bit