move function to CalculateNonVariableTerms