public static Field findNearestFreeField(Level level, Field from, List<Field> bannedFields, HashMap<Field, ArrayList<Object>> conflictingHashMap){
		
		LinkedList<Field> frontier = new LinkedList<Field>();
		
		frontier.add(from);
		HashSet<Field> closedSet = new HashSet<Field>();

		
		Field currentField = frontier.poll();
		closedSet.add(currentField);
				
		while(bannedFields.contains(currentField) && currentField != null){
			
			for (Field neighbour : currentField.neighbors) {
				if(neighbour != null && !frontier.contains(neighbour) &&
						(!conflictingHashMap.containsKey(neighbour) || 
						(conflictingHashMap.containsKey(neighbour) && conflictingHashMap.get(neighbour).contains(from)))){
					frontier.add(neighbour);
					closedSet.add(neighbour);
				}
			}
			
			currentField = frontier.poll();
		}

		return currentField;
	}