for Python3

porting to python3