anchor.diff:  
           /// list of unprocessed token after adding new tree
           let finalUnprocessed = 
  -            let mutable res = [] 
  -            for i = 0 to processed.Length - 1 do
  -                if not processed.[i] 
  -                then res <- new Terminal(i) :: res
  -            List.rev res
  +            let index = ref -1
  +            let processElem elem acc = 
  +                incr index
  +                if elem then acc else new Terminal(!index) :: acc
  +
  +            processedToks
  +            |> Array.fold (fun acc elem -> processElem elem acc) []
   
           // now parameter 'tokens' is all sppf tokens rather than tokens from new tree
           let newTree = new Tree<_> (tokens, tree, rules)
  
positive.code:                 nextFam
  
          let rec processFamily (family : Family) = 
              let children = new ResizeArray<_>()
              
              let processNode (node : AstNode) = 
  
negative.code:             | :? Epsilon -> Unchecked.defaultof<_>
              | _ -> failwith "Strange tree - singleNode with non-negative value"
  
          let processedFamily = new ResizeArray<_>()
  
          let filter family = 
              if processedFamily.Contains family 
              then false
              else inputFilter family
  
          /// choose family from AST which contains the more unprocessed tokens.
          /// if filter returns 'false' for all families then ast.first will be returned. 
          let handleAST (ast : AST) = 
              if ast.other = null || not <| Seq.exists (fun i -> i = false) processedToks
              then 
                  ast.first
              else                
                  let getUnprocessedCount family = 
                      let familyLeaves = 
                          Tree<_>.GetTokensFromFamily family 
                          |> Seq.distinct 
                          |> Seq.toList
                      let newToksList = 
                          unprocessed 
                          |> List.filter 
                              (
                                  fun leaf -> 
                                      familyLeaves 
                                      |> List.exists (fun x -> x.TokenNumber = leaf.TokenNumber)
                              )
                      newToksList.Length
  
                  let mutable nextFam = ast.first
  