public static void computeStats(String directoryName) {
		try {
			if(!ghosteryFile.equals("")) {
				// TRACKERS
				BufferedWriter trackersStatsFile = new BufferedWriter(new FileWriter(new File(directoryName+"/logs/stats_trackers.csv"), false));

				Map<String, Integer> sortedTrackersGhosteryStats = sortByValueInDescendingOrder(trackersGhosteryStats);

				for(String name : sortedTrackersGhosteryStats.keySet()) {
					int trackerCount = sortedTrackersGhosteryStats.get(name);
					if(trackerCount != 0) {
						trackersStatsFile.write(name + "," + trackerCount);
						trackersStatsFile.newLine();
					}
				}
				trackersStatsFile.close();


				// MIMETYPE OF GHOSTERY TRACKERS DETECTED
				BufferedWriter mimetypeGhosteryFile = new BufferedWriter(new FileWriter(new File(directoryName+"/logs/stats_mimetypes_ghostery.csv"), false));

				Map<String, Integer> sortedMimetypeGhostery = sortByValueInDescendingOrder(mimetypeGhostery);

				for(String name : sortedMimetypeGhostery.keySet()) {
					int number = sortedMimetypeGhostery.get(name);
					mimetypeGhosteryFile.write(name + "," + number);
					mimetypeGhosteryFile.newLine();
				}
				mimetypeGhosteryFile.close();
			}


			// MIMETYPE OF URLS OF DIFFERENT SOA
			BufferedWriter mimetypeSOA_allWebsitesFile = new BufferedWriter(new FileWriter(new File(directoryName+"/logs/stats_mimetypes_soa.csv"), false));

			Map<String, Integer> sortedMimetypeSOA_allWebsites = sortByValueInDescendingOrder(mimetypeSOA_allWebsites);

			for(String name : sortedMimetypeSOA_allWebsites.keySet()) {
				int number = sortedMimetypeSOA_allWebsites.get(name);
				mimetypeSOA_allWebsitesFile.write(name + "," + number);
				mimetypeSOA_allWebsitesFile.newLine();
			}
			mimetypeSOA_allWebsitesFile.close();


			// WEBSITES DETAILED STATS
			BufferedWriter websitesDetailedStatsFile = new BufferedWriter(new FileWriter(new File(directoryName+"/logs/stats_detailed.csv"), false));

			for(String name : websitesDetailedStats.keySet()) {
				int[] numbers = websitesDetailedStats.get(name);
				String result = name;
				for(int number : numbers) {
					result += "," + number;
				}
				websitesDetailedStatsFile.write(result);
				websitesDetailedStatsFile.newLine();
			}
			websitesDetailedStatsFile.close();

		} catch (IOException e) {
			logMessage("Error: cannot create the stats file", 1);
			if(debug) e.printStackTrace();
		}
	}