Memorizing intermediate results.