Fix function cache; add comments; Outperform haskell version; BOOYA