Working Python implementation.
Ignore local file.