Memoization seems to be working