first iteration of memoization version is complete