it's been like 8 days since I made these changes
must have been attempting a Haskell impl
cleaned and ready for python