         
         return MortonBound::LowestCommonBound(min, max);
     }
+    */
+
+    __host__ __device__
+    MortonBound operator()(const uint2 rayPartition) const {
+        const MortonCode min = rayMortonCodes[rayPartition.x];
+        const MortonCode max = rayMortonCodes[rayPartition.y-1];
+        MortonBound partitionBound = MortonBound::LowestCommonBound(min, max);
+
+        const SignedAxis axis = min.GetAxis();
+        MortonBound upper = d_initialBounds[axis];
+
+        return MortonBound::Create(Utils::Morton::MaxBy4(partitionBound.min, upper.min),
+                                   Utils::Morton::MinBy4(partitionBound.max, upper.max));
+    }
+
 };
 
 struct CreateHyperCubesFromBounds {

    static thrust::device_vector<MortonBound> bounds(6); bounds.resize(6);
    Kernels::ReduceMinMaxMortonByAxis(rayMortonCodes.begin(), rayMortonCodes.end(),
                                      bounds.begin(), bounds.end());
    //cout << "Bounds:\n" << bounds << endl;

    // Find ray partition pivots
    rayPartitions.resize(6);

        
        const float rayCount = (float)(rayPartition.y - rayPartition.x);
        const float sphereCount = (float)(spherePartition.y - spherePartition.x);
        const bool fewOfAPrimitive = rayCount * sphereCount <= 32.0f * (rayCount + sphereCount);

        return lowestBound || fewOfAPrimitive;
    }
