sums loop