Added fenwick tree for sum and tests.