https://blog.bitsrc.io/advanced-data-structures-and-algorithms-implementing-your-first-binary-indexed-tree-a3fcfd2a98ab