          RawPointer(leafSpheresStartIndex),
          RawPointer(nextRayPartitions) + leafNodes,
          RawPointer(nextSpherePartitions) + leafNodes,
-         activeNodes,
+         nActiveNodes,
          nNewLeafs,
          leafSphereIndices,
          nNewLeafIndices);

void FindNewRayPartitions(const uint2* const rayPartitions,
                          const unsigned int rayPartitionCount,
                          const unsigned int* const rayMortonCodes,
                          uint4* nextRayPartitions) {
    
    const unsigned int id = threadIdx.x + blockDim.x * blockIdx.x;
    

    spherePartitions.resize(cubes.Size());
    thrust::copy(h_spherePartitions.begin(), h_spherePartitions.end(), spherePartitions.begin());
}


std::string MortonDacrtNodes::ToString(const bool verbose) const {
    std::ostringstream out;
