private TransactionUpdater recalculate(List<TTransaction> list) {
    // the first one should not be updated at all (that is a pivot element)

    if (list.isEmpty()) {
      System.out.println(
          "[WARNING] pivot is null, list is empty. " + TransactionUpdater.class.getSimpleName());
      return this;
    }

    // list.isEmpty() == FALSE

    int offset;
    for (offset = 0; offset < list.size() && !list.get(offset).isPivot(); ++offset) ;

    /* in case when no pivot found: nothing to be done */
    if (offset == list.size()) return this;

    int balance = list.get(offset).getBalance();
    TChargeAccount ca = list.get(offset).getCa();

    info("offset = %d, list.size = %d", offset, list.size());
    for (int i = offset + 1; i < list.size(); ++i) {
      TTransaction t = list.get(i);

      if (t.isPivot()) {
        t.setAmount(t.getBalance() - balance);
        info("IS PIVOT: %s", t);

        /* henceforth use the new balance */
        balance = t.getBalance();
      } else {
        if (t.getCatransfer().equals(ca)) {
          /**
           * Transfer transaction (beneficiary side, who gets), balance: don't modify, because this
           * balance is that of the other one (who gives)
           */
          Assert.assertTrue(!t.getCa().equals(ca) && !t.getCa().equals(none));
          Assert.assertTrue(t.getCluster().equals(athelyezes) && athelyezes.getSgn() == -1);

          // t.setBalance(balance + t.getAmount());
          balance += t.getAmount();
        } else if (t.getCa().equals(ca)) {
          /**
           * Simple transaction, knowing the sign (direction: in/out) of the amount, which we are
           * talking about
           */
          Assert.assertTrue(!t.getCatransfer().equals(ca));

          t.setBalance(balance + t.getCluster().getSgn() * t.getAmount());
          balance = t.getBalance();
        }
      }
    }

    return this;
  }