added a primitive memoization