further porting to python 3
further porting to python 3