public double DeltaAdd(Instance inst, double r) {
	//System.out.println("DeltaAdd");
	int S_new;
	int W_new;
	double profit;
	double profit_new;
	double deltaprofit;
	S_new = 0;
	W_new = occ.size();

	if (inst instanceof SparseInstance) {
	  //System.out.println("DeltaAddSparceInstance");
	  for (int i = 0; i < inst.numValues(); i++) {
	    S_new++;

	    if ((Integer) this.occ.get(inst.index(i)) == null) {
	      W_new++;
	    }
	  }
	} else {
	  for (int i = 0; i < inst.numAttributes(); i++) {
	    if (!inst.isMissing(i)) {
	      S_new++;
	      if ((Integer) this.occ.get(i + inst.toString(i)) == null) {
		W_new++;
	      }
	    }
	  }
	}
	S_new += S;


	if (N == 0) {
	  deltaprofit = S_new / Math.pow(W_new, r);
	} else {
	  profit = S * N / Math.pow(W, r);
	  profit_new = S_new * (N + 1) / Math.pow(W_new, r);
	  deltaprofit = profit_new - profit;
	}
	return deltaprofit;
      }