finally Python3ized, hopefully