Binary Indexed Tree implementation - for cumulative frequencies