     }
 
     // initialize permutation to [0, 1, 2, ... ,N-1]
-    thrust::host_vector<int> permutation(N);
+    thrust::device_vector<int> permutation(N);
     thrust::sequence(permutation.begin(), permutation.end());
 
     // sort from least significant key to most significant keys

}


// random digit: integer in [0,10)
int rand10()
{
    return rand() % 10;
}



    size_t N = 20;

    // generate three arrays of random values
    thrust::device_vector<int> upper  = random_vector(N);
    thrust::device_vector<int> middle = random_vector(N);
    thrust::device_vector<int> lower  = random_vector(N);
    
    std::cout << "Unsorted Keys" << std::endl;
    for(size_t i = 0; i < N; i++)
