Simple Fenwick tree implementation