support for python3

implement support for python 3.