converted to python3 syntax