anchor.diff:      let calculateParentAccountBalances (accountBalances : AccountBalance List) : AccountBalance list =
           let addBalancesForParentAccount (accountBalance : AccountBalance) (parentAccountBalances : AccountRealAndBasisAmountsMap) (account : Account) =
               let updatedParentAmounts =
  -                match Map.tryFind account parentAccountBalances with
  -                | Some parentAccountAmounts ->
  -                    let realBalances = List.fold SymbolAmountMap.add parentAccountAmounts.Real accountBalance.Balance
  -                    let basisBalances =
  -                        match accountBalance.Basis with
  -                        | Some basis -> List.fold SymbolAmountMap.add parentAccountAmounts.Basis basis
  -                        | None       -> parentAccountAmounts.Basis
  -                    { parentAccountAmounts with Real = realBalances; Basis = basisBalances }
  -                | None ->
  -                    let balances = List.fold SymbolAmountMap.add Map.empty accountBalance.Balance
  -                    let basisBalances =
  -                        match accountBalance.Basis with
  -                        | Some basis -> List.fold SymbolAmountMap.add Map.empty basis
  -                        | None       -> Map.empty
  -                    { Real = balances; Basis = basisBalances; }
  +                let parentAccountAmounts =
  +                    match Map.tryFind account parentAccountBalances with
  +                    | Some parentAccountAmounts -> parentAccountAmounts
  +                    | None -> { Real = Map.empty; Basis = Map.empty }
  +                RealAndBasisAmounts.addAccountBalanceBalances parentAccountAmounts accountBalance
               Map.add account updatedParentAmounts parentAccountBalances
   
           let buildParentAccountAmounts (parentAccountBalances : AccountRealAndBasisAmountsMap) (accountBalance: AccountBalance) =
  
positive.code:         |> List.fold buildParentAccountAmounts Map.empty
          |> Map.toSeq
          |> Seq.map (fun (account, amounts) ->
              let real = SymbolAmountMap.toSortedAmountList amounts.Real
              let basis = 
                  match Map.isEmpty amounts.Basis with
                  | true  -> None
                  | false -> Some <| SymbolAmountMap.toSortedAmountList amounts.Basis
              {
                  Account = account;
                  Balance = real;
  
negative.code: 
      /// Calculate total balance (sum of all account balances)
      let calculateTotalBalance (accountBalances : AccountBalance List) : AccountBalance =
          let real, basis =
              accountBalances
              |> List.fold RealAndBasisAmounts.addAccountBalanceBalances { Real = Map.empty; Basis = Map.empty }
              |> RealAndBasisAmounts.toSortedAmountLists
  
          {
              Account = "";
  