private int numWallsAround(Location loc)
	{
		Location north = loc.add(0, -1);
		Location east = loc.add(1, 0);
		Location south = loc.add(0, 1);
		Location west = loc.add(-1, 0);

		int yes = 0;
		if (north.getY() >= 0 && map[north.getX()][north.getY()] == nonWall)
			yes++;
		if (east.getX() < xSize && map[east.getX()][east.getY()] == nonWall)
			yes++;
		if (south.getY() < ySize && map[south.getX()][south.getY()] == nonWall)
			yes++;
		if (west.getX() >= 0 && map[west.getX()][west.getY()] == nonWall)
			yes++;
		return yes;
	}