         blocksize = funcAttr.maxThreadsPerBlock > 256 ? 256 : funcAttr.maxThreadsPerBlock;
         blocks = (activeNodes / blocksize) + 1;
         
-        cout << "CreateNextPartitionings<<<" << blocks << ", " << blocksize << ">>>" << endl;
-        cout << "spherePartitions:\n" << spherePartitions << endl;
-        cout << "sphereLeftRightEntries:\n" << sphereLeftRightEntries << endl;
-        cout << "nLeafSphereIndices: " << leafSphereIndices << endl;
-        cout << "nActiveNodes: " << activeNodes << endl;
-        cout << "nLeafNodes: " << leafNodes << endl;
         CreateNextPartitionings<<<blocks, blocksize>>>
             (RawPointer(spherePartitions) + leafNodes,
              RawPointer(sphereLeftRightEntries),
              RawPointer(nextSpherePartitions) + leafNodes,
              leafSphereIndices, activeNodes);
         CHECK_FOR_CUDA_ERROR();
-        cout << "nextSpherePartitions:\n" << nextSpherePartitions << endl;
+        // cout << "nextSpherePartitions:\n" << nextSpherePartitions << endl;
 
         spherePartitions.swap(nextSpherePartitions);
         rayPartitions.swap(nextRayPartitions);

    leafNodeIndices[0] = 0;
    thrust::transform_inclusive_scan(isLeaf.begin(), isLeaf.end(), leafNodeIndices.begin()+1, 
                                     BoolToInt(), thrust::plus<unsigned int>());
    cout << "leafNodeIndices:\n" << leafNodeIndices << endl;
    const size_t nNewLeafs = leafNodeIndices[leafNodeIndices.size()-1];
    cout << "nNewLeafs: " << nNewLeafs << endl;
    

    if (nNewLeafs == 0) { 
        cout << "No new leafs" << endl;
        return false;
    }


    // how's that for documentation!
    unsigned int newOwner = leaf ? 
        leafNodeIndices[owner] + nOldLeafs : 
        owner + nOldLeafs + nNewLeafs - leafNodeIndices[owner]; // TODO Move newOwner and partitioningbegin calculations into own kernel parallized over nodes? Costs extra memory, but should be faster.
        
    nextOwners[newEntry] = newOwner;
}
