                           bounds.begin(), CreateBoundsFromPartitions(rayMortonCodes));
         // cout << "bounds:\n" << bounds << endl;
 
-        static HyperCubes hyperCubes(128); hyperCubes.Resize(bounds.size());
-        thrust::transform(bounds.begin(), bounds.end(), 
-                          hyperCubes.Begin(), CreateHyperCubesFromBounds(rayMortonCoder));
+        // static HyperCubes hyperCubes(128); hyperCubes.Resize(bounds.size());
+        // thrust::transform(bounds.begin(), bounds.end(), 
+        //                   hyperCubes.Begin(), CreateHyperCubesFromBounds(rayMortonCoder));
         // cout << hyperCubes << endl;
         
-        static thrust::device_vector<Cone> cones(hyperCubes.Size()); cones.resize(hyperCubes.Size());
-        thrust::transform(hyperCubes.Begin(), hyperCubes.End(), cones.begin(), CreateCones());
+        static thrust::device_vector<Cone> cones(bounds.size()); cones.resize(bounds.size());
+        thrust::transform(bounds.begin(), bounds.end(), cones.begin(), CreateConesFromBounds(rayMortonCoder));
         // cout << "cones:\n" << cones << endl;
-
 
         // Sphere's are partitioned | LEFT0 | RIGHT0 | LEFT1 | RIGHT1 | ....
         const unsigned int nActiveSpheres = sphereIndices.size() - leafSphereIndices;

        : rayMortonCoder(rMC) {}

    __host__ __device__
    thrust::tuple<SignedAxis, float2, float2, float2, float2, float2> operator()(const MortonBound bound) const {
        HyperCube cube = rayMortonCoder.HyperCubeFromBound(bound);
        
        return thrust::tuple<SignedAxis, float2, float2, float2, float2, float2>

    sphereIndexPartition.resize(sphereIndices.size());
    
    thrust::device_vector<Cone> cones(cubes.Size()); // TODO can't this be passed in from outside to save allocation and dealloc?
    thrust::transform(cubes.Begin(), cubes.End(), cones.begin(), CreateConesFromHypercubes());

    unsigned int spherePartitionPivots[cubes.Size() + 1];
    spherePartitionPivots[0] = 0;
