public int AddInstanceToBestCluster(Instance inst) {

    double delta;
    double deltamax;
    int clustermax = -1;
    if (clusters.size() > 0) {
      int tempS = 0;
      int tempW = 0;
      if (inst instanceof SparseInstance) {
	for (int i = 0; i < inst.numValues(); i++) {
	  tempS++;
	  tempW++;
	}
      } else {
	for (int i = 0; i < inst.numAttributes(); i++) {
	  if (!inst.isMissing(i)) {
	    tempS++;
	    tempW++;
	  }
	}
      }

      deltamax = tempS / Math.pow(tempW, m_Repulsion);

      for (int i = 0; i < clusters.size(); i++) {
	CLOPECluster tempcluster = clusters.get(i);
	delta = tempcluster.DeltaAdd(inst, m_Repulsion);
	//  System.out.println("delta " + delta);
	if (delta > deltamax) {
	  deltamax = delta;
	  clustermax = i;
	}
      }
    } else {
      CLOPECluster newcluster = new CLOPECluster();
      clusters.add(newcluster);
      newcluster.AddInstance(inst);
      return clusters.size() - 1;
    }

    if (clustermax == -1) {
      CLOPECluster newcluster = new CLOPECluster();
      clusters.add(newcluster);
      newcluster.AddInstance(inst);
      return clusters.size() - 1;
    }
    clusters.get(clustermax).AddInstance(inst);
    return clustermax;
  }