@Override
	protected Void doInBackground() throws Exception {
		int hundred=pointsList.size();
		setProgress(0);
		for(int index=0;index<hundred;++index){
			if (isCancelled())
				return null;
			List<Instance> tmpLst=new ArrayList<Instance>();
			//Step 1 --> 4
			Instance p=pointsList.get(index);
			if(p.isClassed())
				continue;
			//Step 2
			tmpLst=getneighbors(p);
			if(tmpLst!=null){
				Cluster c = new Cluster("Cluster " + (clusters.size()+1));
				c.addAll(tmpLst);
				clusters.add(c);

			}
			setProgress(Math.min(Math.round((float)(index*100)/(hundred*2)), 100));
		}

		int length=clusters.size();
		if (isCancelled())
			return null;
		for(int i=0;i<length;++i){
			for(int j=0;j<length;++j){
				if(i!=j){
					//Step 3
					if(addNeighbors(clusters.get(i), clusters.get(j))){
						clusters.get(j).clear();
						setProgress(Math.min(Math.round((float)(i*j*100)/(length*length))+49, 100));
					}
				}
			}
		}
		setProgress(100);

		return null;
	}