worked with Eric, added memoization (?) to store the values in the array so that it would actually compute