correction memoization bottom up