     ReduceMinMaxMortonByAxis(rayMortonCodes.begin(), rayMortonCodes.end(),
                              bounds.begin(), bounds.end());
 
-    MortonBound zNegBound = bounds[5];
-    std::cout << "HyperCube: " << rayMortonCoder.HyperCubeFromBound(zNegBound) << std::endl;
-    
+    // Cull inactive partitions.
+    thrust::device_vector<MortonBound>::iterator boundsEnd = thrust::remove_if(bounds.begin(), bounds.end(), InvalidAxis());
+    bounds.resize(boundsEnd - bounds.begin());
+    std::cout << "Bounds:\n" << bounds << std::endl;
+    
+    MortonBound firstBound = bounds[0];
+    std::cout << "HyperCube: " << rayMortonCoder.HyperCubeFromBound(firstBound) << std::endl;
 
     exit(0);
-
-    // Cull inactive (size 0) partitions.
 
     /*    
     // Geometry partition

#include <iostream>
#include <stdexcept>

#include <thrust/sort.h>
#include <thrust/transform.h>



    __host__ __device__ inline MortonCode& operator=(const unsigned int rhs) { code = rhs; return *this; }
    __host__ __device__ inline void operator+=(const MortonCode rhs) { code += rhs; }
    __host__ __device__ inline MortonCode operator&(const unsigned int rhs) { return MortonCode(code & rhs); }
    __host__ __device__ inline operator unsigned int() const { return code; }
    
    __host__ __device__ inline MortonCode WithoutAxis() const { return MortonCode(code & 0x1FFFFFFF); }
