stop doing the same calculation over and over