     int             entropy_reduction)
 {
     for (int i = 0; i < num_items; ++i)
-    {
-        if (gen_mode == RANDOM) {
-            RandomBits(h_keys[i], entropy_reduction);
-        } else if (gen_mode == UNIFORM) {
-            h_keys[i] = 1;
-        } else {
-            h_keys[i] = i;
-        }
-    }
+        InitValue(gen_mode, h_keys[i], i);
 }
 
 

        h_pairs[i].value = i;
    }

    printf("\nSorting reference solution on CPU..."); fflush(stdout);

    for (int i = 0; i < num_segments; ++i)
    {

        h_reference_keys[i]     = h_keys[h_pairs[i].value];
    }

    if (h_pairs) delete[] h_pairs;
}


