public static ArrayList<Association> refineStepOne(
			ArrayList<Association> associations) {
		ArrayList<Association> temp = new ArrayList<Association>();
		double newAvg = 0;
		for (int i = 0; i < associations.size(); i++) {
			Association current = associations.get(i);
			DataPoint p = Global.DBSIMULATOR.get(current.getPID());
			DataPoint q = Global.DBSIMULATOR.get(current.getQID());
			double d = current.getDistance();
			Cluster c1 = null, c2 = null;
			if (!clusterMap.containsKey(p.getClusterID()))
				clusterMap.put(p.getClusterID(), new Cluster(p));
			c1 = clusterMap.get(p.getClusterID());
			if (c1.getDataPointSet().size() == 1)
				c1.setAverageDistance(p.getAverage());

			if (!clusterMap.containsKey(q.getClusterID()))
				clusterMap.put(q.getClusterID(), new Cluster(q));
			c2 = clusterMap.get(q.getClusterID());
			if (c2.getDataPointSet().size() == 1)
				c2.setAverageDistance(q.getAverage());
			if (c1.getID().equals(c2.getID())
					&& d <= Global.K * c1.getAverageDistance()&& d < Global.MAX_ASSOCIATION_DISTANCE) {
				c1.setChanged(true);
				newAvg = d + (c1.getAverageDistance() * c1.getSize());
				c1.addAssociation(current);
				c1.setAverageDistance(newAvg / c1.getSize());
			} else
				temp.add(current);
		}
		return temp;
	}