Change FenwickTree from class to struct