     
     fileprivate let boundingBoxes: UnsafePointer<BoundingBox>?
     fileprivate var inodeCount: Int
+    fileprivate var lastRowIndex: Int
+    fileprivate var elementCount: Int
     
     fileprivate var root: BVHNode {
         return BVHNode(index: 0, bvh: Unmanaged.passUnretained(self) )

            return .internal
        }
        else {
            return .leaf(elementIndex: index - internalNodeCount)
        }
    }
    

            let leaf1 = index1 >= inodecount
            let leaf2 = index2 >= inodecount
            if leaf1, leaf2 {
                let elementIndex1 = BVH.leafNodeIndexToElementIndex(index1, leafCount: self.elementCount, lastRowIndex: lastRowIndex)
                let elementIndex2 = BVH.leafNodeIndexToElementIndex(index2, leafCount: self.elementCount, lastRowIndex: lastRowIndex)
                callback(elementIndex1, elementIndex2)
            }
            else if leaf1 {
                intersects(index1: index1, index2: 2*index2+1, callback: callback)
