add smart summation