public static void main(String[] args) throws IOException, FileNotFoundException{ 
		long startTime = System.currentTimeMillis();
		BufferedReader br = new BufferedReader(new FileReader("clustering_big.txt"));  
		String line = br.readLine();  
		n = Integer.parseInt(line.split("(\\s)+")[0]);  
		numBits = Integer.parseInt(line.split("(\\s)+")[1]);  

		while((line = br.readLine())!= null){  
			BitSet b = getBitSet(line);  
			clusters.put(b, new ArrayList());
			for (int kk = 0; kk < 3; kk++ ){
				clusters.get(b).add(b); // first ele in the list is bitset itself
				clusters.get(b).add(0); // second ele is the rank of this bitset
			}
		} 
		// the duplicates will be auto merged.
		
		// scan each bitset in the hashmap
		for (BitSet bitEntry : clusters.keySet()){ 
			//get all bitsets for all at distance of 1 or 2 from s  
			ArrayList<BitSet> members = getMembers(bitEntry);  
			
			for (BitSet bitMember : members){  
				union(bitEntry,bitMember);  
			}  
		}  

		int count = 0;  
		//parent of a parent is itself..each cluster has a single parent.   
		for(Map.Entry<BitSet, ArrayList> e : clusters.entrySet()){			
			if (e.getKey().equals(e.getValue().get(0))){  
				count++;  
			}  
		}
		long stopTime = System.currentTimeMillis();
		System.out.println(" running time: " + (stopTime-startTime));		
		//6118
		System.out.println(" num clusters " + count);     
	}