Simplified summation function.