Working on Python implementation.