changed syntax so it can run in Python 3.X