Ported all to Python 3