private void setLeaf() throws Exception {
      //this will fill the ranges array with the number of times 
      //each class type occurs for the instances.
      //System.out.println("ihere");
      if (m_training != null ) {
	
	if (m_training.classAttribute().isNominal()) {
	  FastVector tmp;
	  
	  //System.out.println("ehlpe");
	  m_ranges = new FastVector(1);
	  m_ranges.addElement(new FastVector(m_training.numClasses() + 1));
	  tmp = (FastVector)m_ranges.elementAt(0);
	  tmp.addElement(new Double(0));
	  for (int noa = 0; noa < m_training.numClasses(); noa++) {
	    tmp.addElement(new Double(0));
	  }
	  for (int noa = 0; noa < m_training.numInstances(); noa++) {
	    tmp.setElementAt(new Double(((Double)tmp.elementAt
					 ((int)m_training.instance(noa).
					  classValue() + 1)).doubleValue() + 
					m_training.instance(noa).weight()), 
			     (int)m_training.instance(noa).classValue() + 1);
	    //this gets the current class val and alters it and replaces it
	  }
	}
	else {
	  //then calc the standard deviation.
	  m_ranges = new FastVector(1);
	  double t1 = 0;
	  for (int noa = 0; noa < m_training.numInstances(); noa++) {
	    t1 += m_training.instance(noa).classValue();
	  }
	  
	  if (m_training.numInstances() != 0) {
	    t1 /= m_training.numInstances();
	  }
	  double t2 = 0;
	  for (int noa = 0; noa < m_training.numInstances(); noa++) {
	    t2 += Math.pow(m_training.instance(noa).classValue() - t1, 2);
	  }
	  FastVector tmp;
	  if (m_training.numInstances() != 0) {
	    t1 = Math.sqrt(t2 / m_training.numInstances());
	    m_ranges.addElement(new FastVector(2));
	    tmp = (FastVector)m_ranges.elementAt(0);
	    tmp.addElement(new Double(0));
	    tmp.addElement(new Double(t1));
	  }
	  else {
	    m_ranges.addElement(new FastVector(2));
	    tmp = (FastVector)m_ranges.elementAt(0);
	    tmp.addElement(new Double(0));
	    tmp.addElement(new Double(Double.NaN));
	  }
	}
      }
    }