Port to Python 2