support for python 3
fix more python2 to 3 issues