working on finite sums