docs: private HashMap<DensityGrid, CharacteristicVector> adjustForDenseGrid(DensityGrid dg, CharacteristicVector cv, int dgClass)
  	{
  		//System.out.print("Density grid "+dg.toString()+" is adjusted as a dense grid at time "+this.getCurrTime()+". ");
  
  		// Among all neighbours of dg, find the grid h whose cluster ch has the largest size
  		GridCluster ch;								// The cluster, ch, of h
  		DensityGrid hChosen = new DensityGrid(dg);	// The chosen grid h, whose cluster ch has the largest size
  		double hChosenSize = -1.0;					// The size of ch, the largest cluster
  		DensityGrid dgH;							// The neighbour of g being considered
  		int hClass = NO_CLASS;						// The class label of h
  		int hChosenClass = NO_CLASS;				// The class label of ch
  		Iterator<DensityGrid> dgNeighbourhood = dg.getNeighbours().iterator();
  		HashMap<DensityGrid, CharacteristicVector> glNew = new HashMap<DensityGrid, CharacteristicVector>();
  		
  		while (dgNeighbourhood.hasNext())
  		{
  			dgH = dgNeighbourhood.next();
  		
  			if (this.grid_list.containsKey(dgH))
  			{
  				hClass = this.grid_list.get(dgH).getLabel();
  				if (hClass != NO_CLASS)
  				{
  					ch = this.cluster_list.get(hClass);
  			
  					if (ch.getWeight() > hChosenSize)
  					{
  						hChosenSize = ch.getWeight();
  						hChosenClass = hClass;
  						hChosen = new DensityGrid(dgH);
  					}
  				}
  			}
  		}
  		
  		//System.out.println(" Chosen neighbour is "+hChosen.toString()+" from cluster "+hChosenClass+".");
  		
  		if (hChosenClass != NO_CLASS  && hChosenClass != dgClass)
  		{
  			ch = this.cluster_list.get(hChosenClass);
  			
  			// If h is a dense grid
  			if (this.grid_list.get(hChosen).getAttribute() == DENSE)
  			{
  				//System.out.println("h is dense.");
  				// If dg is labelled as NO_CLASS
  				if(dgClass == NO_CLASS)
  				{
  					//System.out.println("g was labelled NO_CLASS");
  					cv.setLabel(hChosenClass);
  					glNew.put(dg, cv);
  					ch.addGrid(dg);
  					this.cluster_list.set(hChosenClass, ch);
  					
  				}
  				// Else if dg belongs to cluster c and h belongs to c'
  				else
  				{
  					//System.out.println("g was labelled "+dgClass);
  					double gSize = this.cluster_list.get(dgClass).getWeight();
  					
  					if (gSize <= hChosenSize)
  						mergeClusters(dgClass, hChosenClass);
  					else
  						mergeClusters(hChosenClass, dgClass);
  				}
  			}
  		
  			// Else if h is a transitional grid
  			else if (this.grid_list.get(hChosen).getAttribute() == TRANSITIONAL)
  			{
  				//System.out.print("h is transitional.");
  				// If dg is labelled as no class and if h is an outside grid if dg is added to ch
  				if (dgClass == NO_CLASS && !ch.isInside(hChosen, dg))
  				{
  					cv.setLabel(hChosenClass);
  					glNew.put(dg, cv);
  					ch.addGrid(dg);
  					this.cluster_list.set(hChosenClass, ch);
  					//System.out.println(" dg is added to cluster "+hChosenClass+".");
  				}
  				// Else if dg is in cluster c and |c| >= |ch|
  				else if (dgClass != NO_CLASS)
  				{
  					GridCluster c = this.cluster_list.get(dgClass);
  					double gSize = c.getWeight();
  					
  					if (gSize >= hChosenSize)
  					{
  						// Move h from cluster ch to cluster c
  						ch.removeGrid(hChosen);
  						c.addGrid(hChosen);
  						CharacteristicVector cvhChosen = this.grid_list.get(hChosen);
  						cvhChosen.setLabel(dgClass);
  						glNew.put(hChosen, cvhChosen);
  						//System.out.println("dgClass is "+dgClass+", hChosenClass is "+hChosenClass+", gSize is "+gSize+" and hChosenSize is "+hChosenSize+" h is added to cluster "+dgClass+".");
  						this.cluster_list.set(hChosenClass, ch);
  						this.cluster_list.set(dgClass, c);
  					}
  				}
  			}
  		}
  		// If dgClass is dense and not in a cluster, and none if its neighbours are in a cluster,
  		// put it in its own new cluster and search the neighbourhood for transitional or dense
  		// grids to add
  		else if (dgClass == NO_CLASS)
  		{
  			int newClass = this.cluster_list.size();
  			GridCluster c = new GridCluster((CFCluster)dg, new ArrayList<CFCluster>(), newClass);
  			c.addGrid(dg);
  			//System.out.println("Added "+dg.toString()+" to cluster "+newClass+".");
  			this.cluster_list.add(c);
  			cv.setLabel(newClass);
  			glNew.put(dg, cv);
  			
  			// Iterate through the neighbourhood until no more transitional neighbours can be added
  			// (dense neighbours will add themselves as part of their adjust process)
  			dgNeighbourhood = dg.getNeighbours().iterator();
  					
  			while(dgNeighbourhood.hasNext())
  			{
  				DensityGrid dghprime = dgNeighbourhood.next();
  						
  				if (this.grid_list.containsKey(dghprime) && !c.getGrids().containsKey(dghprime))
  				{
  					CharacteristicVector cvhprime = this.grid_list.get(dghprime);
  					if(cvhprime.getAttribute() == TRANSITIONAL)
  					{
  						//System.out.println("Added "+dghprime.toString()+" to cluster "+newClass+".");
  						c.addGrid(dghprime);
  						cvhprime.setLabel(newClass);
  						glNew.put(dghprime, cvhprime);
  					}
  				}
  			}
  	
  			this.cluster_list.set(newClass, c);
  			//System.out.println("Cluster "+newClass+": "+this.cluster_list.get(newClass).toString());		
  		}
  		
  		return glNew;
  	}