Make this compatible with Python 2