public boolean checkGoal(State state) {

		for (int k = 0; k < state.getData().size(); k++) {
			for(int m = 0; m < state.getData().get(k).size(); m++) {
				if (state.getData().get(k).get(m).equals("$") || state.getData().get(k).get(m).equals(".")) {
					return false;
				}
			}
		}
	
		endTime = System.nanoTime(); 
		
		System.out.println("Reached goal state!");
		ArrayList<Character> path = new ArrayList<Character>();
		getPath(path, state);
		System.out.println("path: " + path);
		System.out.println("Nodes generated: " + totalNodesGenerated);
		System.out.println("nodes containing states that were generated previously: " + nodesGeneratedPreviously);
		nodesOnFringe = stack.size();
		System.out.println("Nodes on fringe: " + nodesOnFringe);
		nodesOnExploredList = visited.size();
		System.out.println("Nodes on explored list: " + nodesOnExploredList);
		totalTime = endTime - startTime;
		double printTime = totalTime/BILLION; //nanoseconds / 1000000000 = seconds
		System.out.println("Run time in seconds: " + printTime);
		
		Collections.reverse(path);
		
		System.out.print("Path: ");
		for(int i = 0; i < path.size(); i++) {
			System.out.print(path.get(i) + ", ");
		}

		return true;

	}