private static HashMap<Long, Integer> readHashMap(String directory)
			throws IOException, ClassNotFoundException {
		FileInputStream fin;
		try {
			fin = new FileInputStream(directory);
		} catch (FileNotFoundException e) {
			writeHashMap(directory, new HashMap<Long, Integer>());
			fin = new FileInputStream(directory);
		}

		ObjectInputStream ois = new ObjectInputStream(fin);
		@SuppressWarnings("unchecked")
		HashMap<Long, Integer> map = (HashMap<Long, Integer>) ois.readObject();
		ois.close();

		return map;
	}