public void checkNode(GameState nodeToCheck) {
		if(valid(nodeToCheck)){
			System.out.println("Found shortest way");
			System.out.println("Die Weglaenge ist: "+(nodeToCheck.getaStarG()-1));
			System.out.println("Der weg ist: ");
			while(nodeToCheck.getPredecessor() != null){
				System.out.println(nodeToCheck.toString()+"\n\n");
				nodeToCheck = nodeToCheck.getPredecessor();
			}
			System.out.println(nodeToCheck.toString()+"\n\n");
			System.exit(0);
		}

		if(!closed.containsKey(nodeToCheck.hash())) {
			if (open.contains(nodeToCheck)) {
				if (nodeToCheck.getaStarF() < open.get(open.indexOf(nodeToCheck)).getaStarF()) {
					open.set(open.indexOf(nodeToCheck), nodeToCheck);
				}
			}
			else {
				open.add(nodeToCheck);
			}
		}
	}