Initial port to python3