newVals[index] = j;
vals[index] = j;
  protected void convertInstance(Instance instance) throws Exception {    int index = 0;    double [] newVals = new double [outputFormatPeek().numAttributes()];    // Copy and convert the values    for(int i = 0; i < getInputFormat().numAttributes(); i++) {      if (m_DiscretizeCols.isInRange(i) && 	  getInputFormat().attribute(i).isNumeric()) {	int j;	double currentVal = instance.value(i);	if (m_CutPoints[i] == null) {	  if (instance.isMissing(i)) {	    newVals[index] = Instance.missingValue();	  } else {	    newVals[index] = 0;	  }	  index++;	} else {	  if (!m_MakeBinary) {	    if (instance.isMissing(i)) {	      newVals[index] = Instance.missingValue();	    } else {	      for (j = 0; j < m_CutPoints[i].length; j++) {		if (currentVal <= m_CutPoints[i][j]) {		  break;		}	      }              newVals[index] = j;	    }	    index++;	  } else {	    for (j = 0; j < m_CutPoints[i].length; j++) {	      if (instance.isMissing(i)) {                newVals[index] = Instance.missingValue();	      } else if (currentVal <= m_CutPoints[i][j]) {                newVals[index] = 0;	      } else {                newVals[index] = 1;	      }	      index++;	    }	  }   	}      } else {        newVals[index] = instance.value(i);	index++;      }    }        if (instance instanceof SparseInstance) {      push(new SparseInstance(instance.weight(), newVals));    } else {      push(new Instance(instance.weight(), newVals));    }  }