     nextRayPartitions.resize(rayPartitions.size());
     nextSpherePartitions.resize(spherePartitions.size());
     
-    cudaFuncGetAttributes(&funcAttr, PartitionNewLeafNodes);
+    cudaFuncGetAttributes(&funcAttr, CreateNewLeafNodes);
     blocksize = funcAttr.maxThreadsPerBlock > 256 ? 256 : funcAttr.maxThreadsPerBlock;
     blocks = (nActiveNodes / blocksize) + 1;
-    PartitionNewLeafNodes<<<blocks, blocksize>>>
+    CreateNewLeafNodes<<<blocks, blocksize>>>
         (RawPointer(rayPartitions) + leafNodes,
          RawPointer(spherePartitions) + leafNodes,
          RawPointer(isLeaf),

                                                    RawPointer(nextRayPartitions) + leafNodes);
        //std::cout << "nextRayPartitions:\n" << nextRayPartitions << std::endl;

        // std::cout << "nextRayPartitions:\n" << std::endl;
        // for (int i = 0; i < nextRayPartitions.size(); ++i) {
        //     uint2 partition = nextRayPartitions[i];
        //     unsigned int min = rayMortonCodes[partition.x];
        //     unsigned int max = rayMortonCodes[partition.y-1];
        //     cout << i << ": " << partition << ", min: " << Bitmap(min) << ", max: " << Bitmap(max) << endl;
        // }
        

        // Use the new partitions to approximate the left and right bounds for
        // ray partitions and split the geometry. TODO All of these

    // leaf, then it is the old node index minus the number of new leafs created
    // (plus the number of old leaf nodes that was subtracted earlier). Now
    // how's that for documentation!
    unsigned int newOwner = leaf ? 
        leafNodeIndices[owner] + nOldLeafs : 
        owner + nOldLeafs + nNewLeafs;
        
    nextOwners[newEntry] = newOwner;
}

bool MortonDacrtNodes::CreateLeafNodes() {
