Converted to python3 syntax

I have NOT tested this in python2