adding python 3 compatibility