Started porting for python3 support