Got memoization working