Port to python version 3
Port to python version 3.