converted python 2 stuff to 3