private static String encode(HashMap<Integer, Integer> mappedSides, int resultLength) {
		String[] result = new String[resultLength];
		for (int i = 0; i < mappedSides.size(); i++) {
			// Find the shift amount for this current position
			int diffAmount = 0;
			int thisCorner = mappedSides.get(i);
			for (int j = 0; j < i; j++) {
				if (mappedSides.get(j) < thisCorner) {
					diffAmount++;
				}
			}
			result[i] = Integer.toString(thisCorner - diffAmount);
		}
		// Take the last number off to save space since
		// it will always be 0.
		StringBuilder builder = new StringBuilder();
		for (int i = 0; i < result.length - 1; i++) {
			builder.append(result[i]);
		}
		return builder.toString();
	}