update code to make code python-3 compatible