anchor.diff:                  then completeVLayer layer matricesSize
   
   
  -        for i in 1..matrixSizeExponent do
  +        let lastLayerToHandle = (log (double maxSearchLength + 1.)) / (log 2.) |> ceil |> int
  +        for i in 1..lastLayerToHandle do
               completeLayer i
               
           tMatrix.Item S
  
positive.code:                                                 firstSubLayer 
                                                  toMult
                                              
                  firstMultTasks |> Array.iter performMultiplication
                  completeSubLayer firstSubLayer halfMatricesSize
                        
                  let secondSubLayer =                 
                      reducedLayer 
                      |> Array.map (fun matrix -> matrix.TopMatrix)
                  let secondToMult = 
                      secondSubLayer 
                      |> Array.map (fun matrix -> matrix.RelativeMatrix 0 -(snd matrix.Top - fst matrix.Top - matricesSize), 
                                                  matrix.RelativeMatrix halfMatricesSize 0) 
                  let thirdToMult = 
                      secondSubLayer 
                      |> Array.map (fun matrix -> matrix.RelativeMatrix 0 -halfMatricesSize, 
                                                  matrix.RelativeMatrix (snd matrix.Top - fst matrix.Top - matricesSize) 0)
                  let secondMultTasks = Array.map2 (fun w (f1, f2) -> {where=w; from1=f1; from2=f2}) secondSubLayer secondToMult 
                  let thirdMultTasks = Array.map2 (fun w (f1, f2) -> {where=w; from1=f1; from2=f2}) secondSubLayer thirdToMult 
                          
                  secondMultTasks |> Array.iter performMultiplication
                  thirdMultTasks  |> Array.iter performMultiplication          
                  completeSubLayer secondSubLayer halfMatricesSize
  
  
          and completeLayer layerNum = 
  
negative.code:             let actualCol2Count = (min (snd from2.Top) (stringSize + 1)) - snd from2.Left
              Array2D.init from1.Size actualCol2Count calcCell    
  
          let performMultiplication tasks = 
              let performOne task = 
                  let {where=where; from1=from1; from2=from2} = task
                  let completeOnePair (nt1, nt2) =
                          addToP (nt1, nt2) (subMatrixMult nt1 nt2 from1 from2) where
                  pMatrix |> Map.iter (fun nts _ -> completeOnePair nts)
              tasks |> Array.iter performOne
  
          let layerIsRedundant (layer: SubMatrix.T []) =
              if Array.length layer = 0 
              then true
              else 
                  let layerIsOutOfSearchZone = snd layer.[0].Bottom - fst layer.[0].Bottom + 1 >= maxSearchLength + 1
                  layerIsOutOfSearchZone
          
          let rec completeSubLayer layer matricesSize = 
              if matricesSize = 1 then
                  let headsFromTail (tail, tailProb) = 
                      if complexRules.ContainsKey tail then 
                          complexRules.Item tail |> List.map (fun (head, headProb) -> head, headProb * tailProb)
                      else 
                          []
  
                  let tails row col = pMatrix |> Map.map (fun _ probs -> probs.[row, col-1]) |> Map.filter (fun _ prob -> prob > 0.)
                  let heads (row, col) = tails row col |> Map.toList |> List.map headsFromTail |> List.concat
  
                  layer 
                  |> Array.map (fun (matrix: SubMatrix.T) -> matrix.Top)
                  |> Array.map (fun top -> top, heads top)
                  |> Array.iter (fun (top, heads) -> heads |> updateTMatrixCell (fst top) (snd top - 1))
  
              else
                  let halfMatricesSize = int(matricesSize / 2)
                  let zeroSubLayer = layer |> Array.map (fun (matrix: SubMatrix.T) -> matrix.BottomMatrix)                        
                  completeSubLayer zeroSubLayer halfMatricesSize
                  completeVLayer layer matricesSize
  
          and completeVLayer layer matricesSize =
              let halfMatricesSize = int(matricesSize / 2)
              let reducedLayer = 
                  if snd layer.[Array.length layer - 1].Top > stringSize + 1 
                  then layer.[0..Array.length layer - 2] 
                  else layer
  
              let firstSubLayer = 
                  if Array.length layer = Array.length reducedLayer
                  then
                      layer 
                      |> Array.collect (fun matrix -> [|matrix.LeftMatrix; matrix.RightMatrix|])
                  else
                      let reducedMatrix = layer.[Array.length layer - 1]
                      let allButOne = 
                          reducedLayer 
                          |> Array.collect (fun matrix -> [|matrix.LeftMatrix; matrix.RightMatrix|])
                      Array.append allButOne [| reducedMatrix.LeftMatrix |]   
  
              if not <| layerIsRedundant firstSubLayer
              then
                  let toMult = 
                      //todo: annotation?
                      let getMults i (matrix: SubMatrix.T) =
  