adding pure-Python implementation of Gob's algorithm