changes for Python3 compatibility