converting to Python 3