Adding a memoize function
The actually memoize function itself