public static Object[] discreetKNNClassifyUniqueK(Point coord,ArrayList<Point> positiveCoords ,ArrayList<Point> negativeCoords, int k)
    {
	// Stores the nearest neighbours.
	Vector<Neighbour> neighbours = new Vector<Neighbour>();

	// Calculate distances to neighbours
	for(int i = 0; i < positiveCoords.size();i++)
	{
	    double distance = Common.distance(coord.getX(),coord.getY(),positiveCoords.get(i).getX(),positiveCoords.get(i).getY());
	    neighbours.add(new Neighbour(distance, Constants.PULSAR));
	}

	for(int i = 0; i < negativeCoords.size();i++)
	{
	    double distance = Common.distance(coord.getX(),coord.getY(),negativeCoords.get(i).getX(),negativeCoords.get(i).getY());
	    neighbours.add(new Neighbour(distance, Constants.RFI));
	}

	// Sort the neighbours such that element zero has the smallest distance.
	Collections.sort(neighbours);

	if(k > neighbours.size())
	{
	    System.out.println("K larger than number of neihbours. K "+ k + " Neihbours"+ neighbours.size());
	    return null;
	}

	System.out.println("K value:"+ k);

	//for(int i =0; i < neighbours.size();i++)
	//{
	//    System.out.println("Neighbour: "+ i + " "+ neighbours.elementAt(i).toString());
	//} // Debugging purposes

	int k_count =0;
	Vector<Neighbour> k_nearest_neighbours = new Vector<Neighbour>();
	Vector<NearestNeighbour> knn = new Vector<NearestNeighbour>();

	NearestNeighbour currentNeighbour = null;
	
	for(int i =0; i < neighbours.size();i++)
	{
	    // if the distance measure found is unique
	    if(!k_nearest_neighbours.contains(neighbours.elementAt(i)))
	    {
		// increment count of K unique neighbours found.
		k_count++;

		if(currentNeighbour != null)
		{
		    knn.add(currentNeighbour);
		    currentNeighbour = null;
		}
		
		if(k_count > k)// if we have more than K unique examples found
		    break;// break the loop

		
		currentNeighbour = new NearestNeighbour(neighbours.elementAt(i).getDistance(),k_count);
		currentNeighbour.processNeighbour(neighbours.elementAt(i));
		
		// else add the new unique neighbour
		k_nearest_neighbours.add(neighbours.elementAt(i));		
	    }
	    else // the neighbour is not unique, but repeated
	    {
		currentNeighbour.processNeighbour(neighbours.elementAt(i));
		k_nearest_neighbours.add(neighbours.elementAt(i));// still keep the neighbour for majority voting 
	    }

	}

	if(currentNeighbour != null )
	{
	    knn.add(currentNeighbour);
	    currentNeighbour = null;
	}

	for(int i = 0 ; i < knn.size();i++)
	{
	    System.out.println(knn.get(i).toString());
	}
	
	// do some explicit house keeping
	// for no other reason other than it makes me feel better :D
	neighbours.clear();
	neighbours = null;
	
	String classification = NearestNeighbour.getClassificationBTR(knn);
	System.out.println("Classification:"+classification);
	return new Object[]{classification,coord};
    }