if(print==true) OOPS("K: "+i);
    public double simpleKNearestNeighbour(Instance target) throws Exception {      //debug      //boolean print=false;      //if(target.toString().startsWith("40-49,premeno,25-29,0-2,no,2"))   //target.value(0) == 146)      //{ print=true; System.out.println("Inspecting node: "+this.nodeToString(true)); }              double dist = 0;      int currIndex;      // sets and uses:      //   double m_MinDist      //   double m_MaxMinDist      //   int m_FurthestNear      int i = m_NearestListLength;      int index = m_Start;      // if no instances, return max value as distance      if (m_End < m_Start) 	return Double.MAX_VALUE;            //if(target.value(0)==146 && i>0)      //  System.out.println("Initialized i to "+m_NearestListLength);            if (m_NearestListLength<m_kNN) {	for (;(index <= m_End) && (i < m_kNN);) {           currIndex = m_InstList[index]; 	  Instance trainInstance = m_Instances.instance(m_InstList[index]);	  if (target != trainInstance) { // for hold-one-out cross-validation            if(print==true)              OOPS("K: "+i);            dist = m_EuclideanDistance.distance(target, trainInstance, Double.MAX_VALUE, print);	    m_NearestList[i] = currIndex;	    m_DistanceList[i] = dist;	    i++;	  }	  index++;	}        m_NearestListLength = i;                  //if(print==true) {  //target.value(0)==146)         //  System.out.println("New m_NearestListLength: "+m_NearestListLength);        //  for(int j=0; j<m_NearestListLength; ) {        //    System.out.println(j+": "+m_Instances.instance(m_NearestList[j])+","+m_DistanceList[j]);        //    j++;        //  }                  //}      }            /*	System.out.print("dist: ");      for (int j = 0; j < m_kNN; j++) {	System.out.print(" " + m_DistanceList[j]);      }      System.out.println();      System.out.print("near: ");      for (int j = 0; j < m_kNN; j++) {	System.out.print(" " + m_NearestList[j]);      }      System.out.println();      */            // set the new furthest nearest      m_FurthestNear = checkFurthestNear();  //FURTHEST IN m_kNN NEAREST NEIGHBOURS      m_MaxMinDist = m_DistanceList[m_FurthestNear];            int firstFurthestIndex=-1;      double firstFurthestDistance = -1;      int oldNearestListLength = -1;      // check all or rest of instances if nearer      for (; index <= m_End; index++) {	      	currIndex = m_InstList[index];	Instance trainInstance = m_Instances.instance(currIndex);	if (target != trainInstance) { // for hold-one-out cross-validation                    if(print==true)            OOPS("K: "+m_NearestListLength);          dist = m_EuclideanDistance.distance(target, trainInstance, m_MaxMinDist, print);	            // is instance one of the nearest?          if (dist < m_MaxMinDist) {                        // set instance as one of the nearest,            // replacing the last furthest nearest            firstFurthestIndex = m_NearestList[m_FurthestNear];            firstFurthestDistance = m_DistanceList[m_FurthestNear];            m_NearestList[m_FurthestNear] = currIndex;            m_DistanceList[m_FurthestNear] = dist;                        // set the new furthest nearest            m_FurthestNear = checkFurthestNear();            m_MaxMinDist = m_DistanceList[m_FurthestNear];            if (m_MultipleFurthest) {              // remove multiple entries of old furthest nearest              oldNearestListLength = m_NearestListLength;              m_NearestListLength = m_kNN;              m_MultipleFurthest = false;            }            //the instance just replaced is at same distance as furthest nearest            //therefore there are multiple furthest nearest            if (firstFurthestDistance == m_MaxMinDist) {              m_MultipleFurthest = true;              if(oldNearestListLength!=-1)                m_NearestListLength = oldNearestListLength;              m_NearestList[m_NearestListLength] = firstFurthestIndex;              m_DistanceList[m_NearestListLength] = firstFurthestDistance;              m_NearestListLength++;            }                        //get rid of the old list length as it is no longer needed and can create problems.            oldNearestListLength = m_NearestListLength;          }          else {            if (dist == m_MaxMinDist) {              // instance is at same distance as furthest nearest              m_MultipleFurthest = true;              m_NearestList[m_NearestListLength] = currIndex;              m_DistanceList[m_NearestListLength] = dist;              m_NearestListLength++;            }          }	}                //if(m_NodeNumber==10) {        //  System.out.println("Processed index: "+index);        //  for(int j=0; j<m_NearestListLength; ) {        //    System.out.println(j+": "+m_Instances.instance(m_NearestList[j])+","+m_DistanceList[j]);        //    j++;        //  }        //}              }            //debug      //if(print==true) { //target.value(0)==146) {      //  for(int j=0; j<m_NearestListLength; ) {      //    System.out.println(j+": "+m_Instances.instance(m_NearestList[j])+","+m_DistanceList[j]);      //    j++;      //  }      //  System.out.println("====================");      //}            return m_MaxMinDist;    }