#71, port to python 3