started python 3 compatibility, using six library