public static Maze parseMaze(String filename) throws IOException{
		/* Parse to lines of strings */
		List<String> mazeText = new ArrayList<String>();
		BufferedReader br = new BufferedReader(new FileReader(filename));
		String line;
		int mazeHeight = 0;
		int mazeWidth = 0;
		while ((line = br.readLine()) != null) {
		    // process the line.
			String noNewLine = line.split("\n")[0];
			mazeText.add(noNewLine);
			mazeHeight++;
		}
		br.close();
		mazeWidth = mazeText.get(0).length();
		out.println("mazeHeight is " + mazeHeight);
		out.println("mazeWidth is " + mazeWidth);
		/* Get the size of the maze, allocate int maze */
		int [][] maze = new int[mazeWidth][mazeHeight];
		/* Find entrance and exit of the maze, mark walls and paths */
		int [] start = new int[2]; // 0: width, 1: height 
		ArrayList<Pair<Integer, Integer>> goals = new ArrayList<Pair<Integer, Integer>>(); 
		String a = "00";
		
		for(int i=0; i<mazeWidth; i++){
			for(int j=0; j<mazeHeight; j++){			
				char curr = mazeText.get(j).charAt(i);
				if(curr == 'P'){ // entrance: s
					maze[i][j] = 2;
					start[0] = i;
					start[1] = j;
				}
				else if(curr == '.'){ // exit: g
					maze[i][j] = 3;
					Pair<Integer, Integer> goal = new Pair<Integer, Integer>(i, j);
					goals.add(goal);
				}
				else if(curr == '%'){ // walls: 1
					maze[i][j] = 1;
				}
				else{ // path
					maze[i][j] = 0;					
				}
			}
		}
		
		Maze myMaze = new Maze(start, goals, maze);
		return myMaze;
	}