Porting to python 3.