public static String[][] translator(String textmap) {
		int xSize;
		int ySize;
		String[][] stringMapArray = null;
		//first we need to check that the map is legitimate by calling mapchecker.
		if (mapchecker(textmap)) {
			try {
				//Initiate a buffered reader to read form the file
				BufferedReader reader = new BufferedReader(new FileReader(
						textmap));
				//takes the size of the map from the first two lines the first line being the xsize and the second line being the ysize. also removing spaces
				xSize = Integer.parseInt(reader.readLine().replaceAll("\\s",""));
				ySize = Integer.parseInt(reader.readLine().replaceAll("\\s",""));
				// now we know the size of the map we can set up the 2d array of strings.
				stringMapArray = new String[xSize][ySize];
				// the following for loop finds reads each line and adds each character as to the array
				for (int y = 0; y < (ySize); y++) {
					String lineinput = reader.readLine().replaceAll("\\s","");
					for (int x = 0; x < (xSize); x++) {
						stringMapArray[x][y] = String.valueOf(lineinput
								.charAt(x));
					}
				}
				//closes the reader
				reader.close();

			}
			
			catch (FileNotFoundException e) {
				System.err.println("unable to open");

			} catch (IOException e) {
				System.err.println("a problem was encountered reading");
			}

		} 
		//if the checker does not accept the map then it prints "map not acceptable".
		else {
			System.err.println("Map not accectable");
		}
		
		return stringMapArray;
	}