WIP: moving for Python3
Py3 compatibility
Also works on python2