public int indexFromPath(Direction [] path) {
		int pathIndex = -1;
		for(int j = 0; j < directions.length; j++) {
			Direction [] nextPath = directions[j];
			if(nextPath.length == path.length) {
				boolean matches = true;
				for(int i = 0; i < nextPath.length; i++) {
					if(!path[i].equals(nextPath[i])) {
						matches = false;
					}
				}
				if(matches) {
					pathIndex = j;
					break;
				}
			}
		}
		return pathIndex;
	}