Start of memoization, still a problem iwth recursion