public static int getFirstOrderClassification(List<GraphPoint> neighbours)
	{
		int votes[] = new int[Point.classes.length];
		
		// Count the classes of all the neighbours
		Iterator<GraphPoint> neighbourIterator = neighbours.iterator();
		while(neighbourIterator.hasNext())
		{
			int classIndex = Point.getClassIndex(neighbourIterator.next().getClassification());
			votes[classIndex]++;
		}

		// Build a list of possible classes
        List<Integer> possibleClasses = new ArrayList<Integer>();
        int maxVotes = 0;
        
        // Find the class with the most votes
        for(int i = 0; i < (Point.classes.length); i++)
        {
        	if(votes[i] > maxVotes) maxVotes = votes[i];
        }

        // Find the class(es) with the most votes.
        for (int i = 0; i < votes.length; i++)
        {
            if (votes[i] == maxVotes)
                possibleClasses.add(Point.classes[i]);
        }
        
        // If more than one class is possible, use the most common one
        if(possibleClasses.size() == 1)
        	return possibleClasses.get(0);
        else
        {
        	int mostCommonClass = 0, mostCommonClassVotes = 0;
        	for(Integer i : possibleClasses)
        	{
        		if(totalVotes[Point.getClassIndex(i)] > mostCommonClassVotes)
        		{
        			mostCommonClassVotes = totalVotes[Point.getClassIndex(i)];
        			mostCommonClass = i;
        		}
        	}
        	
        	return mostCommonClass;
        }
	}