                       owners.begin(), partitionLeafs);
     // std::cout << "index moved to:\n" << owners << std::endl;
 
+    // TODO change to device_vector.swap, but that crashes right now
     std::swap(currentIndices, nextIndices);
+    //currentIndices.swap(nextIndices);
 
     // std::cout << ToString() << std::endl;
 }

    PartitionLeftRight partitionLeftRight(nextIndices);
    thrust::for_each(input, input + CurrentSize(), partitionLeftRight);

    std::swap(currentIndices, nextIndices);
}


__constant__ unsigned int d_leafIndexOffset;


                                     thrust::device_vector<unsigned int>& owners) {

    /*
    std::cout << "--SphereContainer::PartitionLeafs--:" << std::endl;
    std::cout << "isLeaf:\n" << isLeaf << std::endl;
    std::cout << "leafNodeIndices:\n" << leafNodeIndices << std::endl;
    std::cout << "spherePartitions:\n" << spherePartitions << std::endl;
