Feat py3k

Ported to py3