Updated the algorithm to save one variable.