initial attempt to port to python 3