anchor.diff:              Math.isBoundsIntersectingBounds bounds node.Bounds
   
           let rec internal addElement bounds element node =
  -            let nodes =
  -                node.Children |>
  -                Array.filter (fun node -> inBounds bounds node)
  -            match nodes.Length with
  -            | 0 -> node.Elements.Add element |> ignore
  -            | 1 -> let child = nodes.[0] in addElement bounds element child
  -            | _ -> failwithumf ()
  +            if intersectingBounds bounds node then
  +                match node.Children with
  +                | Left nodes -> for node in nodes do addElement bounds element node
  +                | Right elements -> elements.Add element |> ignore
   
           let rec internal removeElement bounds element node =
  -            let nodes =
  -                node.Children |>
  -                Array.filter (fun node -> inBounds bounds node)
  -            match nodes.Length with
  -            | 0 -> node.Elements.Remove element |> ignore
  -            | 1 -> let child = nodes.[0] in removeElement bounds element child
  -            | _ -> failwithumf ()
  +            if intersectingBounds bounds node then
  +                match node.Children with
  +                | Left nodes -> for node in nodes do removeElement bounds element node
  +                | Right elements -> elements.Remove element |> ignore
   
  -        let rec internal getElementsAtPoint point node (list : 'e List) =
  -            for element in node.Elements do list.Add element
  -            for child in node.Children do
  -                if atPoint point child then
  -                    getElementsAtPoint point child list
  +        let rec internal updateElement oldBounds newBounds element node =
  +            match node.Children with
  +            | Left nodes ->
  +                for node in nodes do
  +                    if intersectingBounds oldBounds node || intersectingBounds newBounds node then
  +                        updateElement oldBounds newBounds element node
  +            | Right elements ->
  +                if intersectingBounds oldBounds node then
  +                    if not (intersectingBounds newBounds node) then elements.Remove element |> ignore
  +                elif intersectingBounds newBounds node then
  +                    elements.Add element |> ignore
   
  -        let rec internal getElementsInBounds bounds node (list : 'e List) =
  -            for element in node.Elements do list.Add element
  -            for child in node.Children do
  -                if intersectingBounds bounds child then
  -                    getElementsInBounds bounds child list
  +        let rec internal getElementsAtPoint point node (set : 'e HashSet) =
  +            match node.Children with
  +            | Left nodes -> for node in nodes do if atPoint point node then getElementsAtPoint point node set
  +            | Right elements -> for element in elements do set.Add element |> ignore
  +
  +        let rec internal getElementsInBounds bounds node (set : 'e HashSet) =
  +            match node.Children with
  +            | Left nodes -> for node in nodes do if intersectingBounds bounds node then getElementsInBounds bounds node set
  +            | Right elements -> for element in elements do set.Add element |> ignore
   
           let internal getDepth node =
               node.Depth
  
positive.code:         private
              { Depth : int
                Bounds : Vector4
                Children : 'e SpatialNode array
                Elements : 'e HashSet }
  
      [<RequireQualifiedAccess>]
      module internal SpatialNode =
  
negative.code:     [<RequireQualifiedAccess>]
      module SpatialTree =
      
          let addElement omnipresent bounds element tree =
              if omnipresent then 
                  tree.OmnipresentElements.Add element |> ignore
              else
                  if not (SpatialNode.inBounds bounds tree.Node) then
                      Log.info "Element is beyond spatial tree's containment area or is being added redundantly."
                      tree.OmnipresentElements.Add element |> ignore
                  else SpatialNode.addElement bounds element tree.Node
  
          let removeElement omnipresent bounds element tree =
              if omnipresent then 
                  tree.OmnipresentElements.Remove element |> ignore
              else
                  if not (SpatialNode.inBounds bounds tree.Node) then
                      Log.info "Element is beyond spatial tree's containment area or is not present for removal."
                      tree.OmnipresentElements.Remove element |> ignore
                  else SpatialNode.removeElement bounds element tree.Node
      
          let updateElement
              oldOmnipresent oldBounds
              newOmnipresent newBounds
              element tree =
              // OPTIMIZATION: only update when element is not omnipresent
              if not oldOmnipresent || not newOmnipresent then
                  SpatialNode.updateElement oldBounds newBounds element tree.Node
  
          let getElementsAtPoint point tree =
              let set = HashSet tree.OmnipresentElements
              SpatialNode.getElementsAtPoint point tree.Node set
              set
      
          let getElementsInBounds bounds tree =
              let set = HashSet tree.OmnipresentElements
              SpatialNode.getElementsInBounds bounds tree.Node set
              set
      
          let getDepth tree =
              SpatialNode.getDepth tree.Node
  