finished python 2 to python 3 conversion