a function that is able to cache potentially time-consuming computations.