I have fixed bugs in memoization