public final void attrSplit(int attr, Instances inst) throws Exception {
    int		i;
    int		len;
    int		part;
    int		low = 0;
    int		high = inst.numInstances() - 1;
    PairedStats full = new PairedStats(0.01);
    PairedStats leftSubset = new PairedStats(0.01);
    PairedStats rightSubset = new PairedStats(0.01);
    int		classIndex = inst.classIndex();
    double      leftCorr, rightCorr;
    double      leftVar, rightVar, allVar;
    double      order = 2.0;

    initialize(low, high, attr);

    if (m_number < 4) {
      return;
    } 

    len = ((high - low + 1) < 5) ? 1 : (high - low + 1) / 5;
    m_position = low;
    part = low + len - 1;

    // prime the subsets
    for (i = low; i < len; i++) {
      full.add(inst.instance(i).value(attr), 
	       inst.instance(i).value(classIndex));
      leftSubset.add(inst.instance(i).value(attr), 
		     inst.instance(i).value(classIndex));
    } 

    for (i = len; i < inst.numInstances(); i++) {
      full.add(inst.instance(i).value(attr), 
	       inst.instance(i).value(classIndex));
      rightSubset.add(inst.instance(i).value(attr), 
		      inst.instance(i).value(classIndex));
    } 

    full.calculateDerived();

    allVar = (full.yStats.stdDev * full.yStats.stdDev);
    allVar = Math.abs(allVar);
    allVar = Math.pow(allVar, (1.0 / order));

    for (i = low + len; i < high - len - 1; i++) {
      rightSubset.subtract(inst.instance(i).value(attr), 
			   inst.instance(i).value(classIndex));
      leftSubset.add(inst.instance(i).value(attr), 
		     inst.instance(i).value(classIndex));

      if (!Utils.eq(inst.instance(i + 1).value(attr), 
		    inst.instance(i).value(attr))) {
	leftSubset.calculateDerived();
	rightSubset.calculateDerived();

	leftCorr = Math.abs(leftSubset.correlation);
	rightCorr = Math.abs(rightSubset.correlation);
	leftVar = (leftSubset.yStats.stdDev * leftSubset.yStats.stdDev);
	leftVar = Math.abs(leftVar);
	leftVar = Math.pow(leftVar, (1.0 / order));
	rightVar = (rightSubset.yStats.stdDev * rightSubset.yStats.stdDev);
	rightVar = Math.abs(rightVar);
	rightVar = Math.pow(rightVar, (1.0 / order));

	double score = allVar - ((leftSubset.count / full.count) * leftVar) 
		       - ((rightSubset.count / full.count) * rightVar);

	// score /= allVar;
	leftCorr = (leftSubset.count / full.count) * leftCorr;
	rightCorr = (rightSubset.count / full.count) * rightCorr;

	double c_score = (leftCorr + rightCorr) - Math.abs(full.correlation);

	// c_score += score;
	if (!Utils.eq(score, 0.0)) {
	  if (score > m_maxImpurity) {
	    m_maxImpurity = score;
	    m_splitValue = 
	      (inst.instance(i).value(attr) + inst.instance(i + 1)
	      .value(attr)) * 0.5;
	    m_position = i;
	  } 
	} 
      } 
    } 
  }