converted to python 3