Implements memoize
Merge pull request #54 from patrickgombert/memoize

Implements memoize