     Saiga::thrust::pinned_vector<T> h_data(N), res;
     thrust::device_vector<T> d_data(N);
 
+    // Initialize with random values
     for(auto& f : h_data)
     {
         f = abs(rand());
 
     }
     d_data = h_data;
-
-    cout << "Sorting " << N << " elements..." << endl;
-
-
-
-    radixSort(d_data);
-
-
+    {
+        cout << "Sorting " << N << " elements..." << endl;
+        radixSort(d_data);
+    }
     res = d_data;
 
+    // Check result
     int prev = res[0];
     for(auto& d : res)
     {

#include "thrust/scan.h"
#include "thrust/scatter.h"






using Saiga::ArrayView;


template<bool one>
struct GetBitOp
{

        return ((a >> k) & 1) == one;
    }
};

static void radixSortHelper(
        thrust::device_vector<int>& d,
