Python3 compatibility, progress update. Working version (yay!)