implement summation