finished python 3 conversion