         }
 
         // Store current key and value
-        keys.push_back(current_key);
-        values.push_back(current_value);
+        pairs.push_back(std::make_pair(current_key, current_value));
 
         // Use a STL map to keep track of the max value for each key
         auto found = expected_values.find(current_key);


  const int THREAD_BLOCK_SIZE{256};

  std::vector<key_type> keys;
  std::vector<value_type> values;
  thrust::device_vector<key_type> d_keys;
  thrust::device_vector<value_type> d_values;

  std::unordered_map<key_type, value_type> expected_values;


      }
    }

    if(shuffle == true)
      std::random_shuffle(pairs.begin(), pairs.end());

    d_pairs = pairs;

    return thrust::raw_pointer_cast(d_pairs.data());
  }

  void check_answer(){
