add CalculateFactor2 function