private Map<Double, Map<Double, Integer>> process(ResultSet resampleSet,
			int repct) throws SQLException {
		Map<Double, Map<Double, Integer>> map = new TreeMap<Double, Map<Double, Integer>>();

		while (resampleSet.next()) {

			double err = resampleSet.getDouble(errorType);
			if (err >= errorCutoff) {
				continue;
			}

			double spread = resampleSet.getDouble(spreadRateField);
			double distance = resampleSet.getDouble(spreadDistanceField);

			if (!map.containsKey(spread)) {
				Map<Double, Integer> insert = new TreeMap<Double, Integer>();
				insert.put(distance, 1);
				map.put(spread, insert);
			} else {
				Map<Double, Integer> retrieve = map.get(spread);
				if (!retrieve.containsKey(distance)) {
					retrieve.put(distance, 1);
				} else {
					retrieve.put(distance, retrieve.get(distance) + 1);
				}
			}
		}

		// Trim map down using requiredReplicates

		int requiredReplicates = (int) (performanceCriterion * repct);

		// First iterate over resampleIDs

		Iterator<Double> it = map.keySet().iterator();
		while (it.hasNext()) {
			Double dbl = it.next();

			// Then iterate over the pair values

			Map<Double, Integer> submap = map.get(dbl);
			Iterator<Double> it2 = submap.keySet().iterator();
			while (it2.hasNext()) {
				Double val = it2.next();
				if (submap.get(val) < requiredReplicates) {
					it2.remove();
				}
			}
		}

		// Eliminate empty tables

		it = map.keySet().iterator();

		while (it.hasNext()) {
			Double dbl = it.next();
			if (map.get(dbl).isEmpty()) {
				it.remove();
			}
		}
		return map;
	}