Some changes to ledger hierarchy code. Not compiled