Reimplementing it in Python.