make it work on python 3 as well