update fib with memoization