public static void main(String[] args) throws Exception {
		tr = new ConcurrentHashMap<Long, UserNode>();
		File urlsDir = new File(urlsDirName);
		File[] urlFiles = urlsDir.listFiles();
		System.out.println("Number of Files " + urlFiles.length);
		for (int i = 0; i < urlFiles.length; i++) {
			System.out.println(urlFiles[i].getPath());
			ArrayList<Integer>[] urls = readUrls(urlFiles[i].getPath());
			// for (int i = 0; i < NUM_THREADS; i++)
			// graphs.add(new FollowingGraph(usersDirectory,
			// MAX_FOLLOWERS_CACHED
			// / NUM_THREADS));
			System.out.println("Total Urls: " + urls.length);
			ExecutorService executor = Executors
					.newFixedThreadPool(NUM_THREADS);
			for (ArrayList<Integer> e : urls) {
				// if (finishedFiles.containsKey(f.getName()))
				// continue;
				Task task = new Task(e);
				executor.execute(task);
				// if (cnt == 5000)
				// break;
			}
			executor.shutdown();
			executor.awaitTermination(60, TimeUnit.MINUTES);
		}
		System.out.println(tr.size());
		UsersReader reader = UsersReader.getInstance();
		FileWriter fw = new FileWriter(outDirectory + "TotalData.txt", false);
		int failnull = 0;
		int faildata = 0;
		for (Entry<Long, UserNode> e : tr.entrySet()) {
			UserData u = reader.getUser((int) ((long) e.getKey()));
			if (u != null) {
				if (e.getValue().minLocalInf == Integer.MAX_VALUE) {
//					e.getValue().init();
					faildata++;
					continue;
				}
				StringBuilder sb = new StringBuilder();
				sb.append(u.followers + ",");
				sb.append(u.friends + ",");
				sb.append(e.getValue().tweets + ",");
				sb.append(u.dateJoined + ",");
				sb.append(e.getValue().totalInfSum.floatValue()
						/ e.getValue().tweets.floatValue() + ",");
				sb.append(e.getValue().minTotalInf + ",");
				sb.append(e.getValue().maxTotalInf + ",");

				sb.append(e.getValue().localInfSum.floatValue()
						/ e.getValue().tweets.floatValue() + ",");
				sb.append(e.getValue().minLocalInf + ",");
				sb.append(e.getValue().maxLocalInf + ",");
				sb.append(u.id + "\n");
								
				fw.write(sb.toString());
			} else {
				if (u == null)
					failnull++;
			}
		}
		System.out.println("nulls " + failnull);
		System.out.println("baddata " + faildata);
		fw.close();
	}