private Instances assignClassValue(Instances dataSet) {
    if (dataSet.classIndex() < 0) {
      if (m_logger != null) {
	m_logger.
	  logMessage("[ClassValuePicker] " 
	      + statusMessagePrefix() 
	      + " No class attribute defined in data set.");
	m_logger.statusMessage(statusMessagePrefix()
	    + "WARNING: No class attribute defined in data set.");
      }
      return dataSet;
    }
    
    if (dataSet.classAttribute().isNumeric()) {
      if (m_logger != null) {
	m_logger.
	  logMessage("[ClassValuePicker] "
	      + statusMessagePrefix()
	      + " Class attribute must be nominal (ClassValuePicker)");
	m_logger.statusMessage(statusMessagePrefix()
	    + "WARNING: Class attribute must be nominal.");
      } else {
        m_logger.statusMessage(statusMessagePrefix() + "remove");
      }
      return dataSet;
    }

    if (m_classValueIndex != 0) { // nothing to do if == 0
      // swap selected index with index 0
      try {
	SwapValues sv = new SwapValues();
	sv.setAttributeIndex(""+(dataSet.classIndex()+1));
	sv.setFirstValueIndex("first");
	sv.setSecondValueIndex(""+(m_classValueIndex+1));
	sv.setInputFormat(dataSet);
	Instances newDataSet = Filter.useFilter(dataSet, sv);
	newDataSet.setRelationName(dataSet.relationName());
	return newDataSet;
      } catch (Exception ex) {
	if (m_logger != null) {
	  m_logger.
	    logMessage("[ClassValuePicker] "
	        +statusMessagePrefix()
	        + " Unable to swap class attibute values.");
	  m_logger.statusMessage(statusMessagePrefix()
	      + "ERROR (See log for details)");
	}
      }
    }
    return dataSet;
  }