public String makeMap(int x, int y, int numPits, int numBats){

        int size = x * y;
        if(size <= 0){
            return "error :(";
        }
        
        String[][] map = new String[x][y];
        littleRoom[][] rooms = new littleRoom[x][y];
        
        for(int i = 0; i < x; i++){
        	for(int j = 0; j < y; j++){
        		map[i][j] = "";
        		rooms[i][j] = new littleRoom();
        	}
        }

        
        String[][] mapAttempt = new String[map.length][];
        littleRoom[][] roomAttempt = new littleRoom[map.length][];
        do{
        	 mapAttempt = new String[x][y];
        	 roomAttempt = new littleRoom[x][y];
        	 
             for(int i = 0; i < map.length; i++){
            	 for(int j = 0; j < map[0].length; j++){
	            	mapAttempt[i][j] = "";
	                roomAttempt[i][j] = new littleRoom();
            	 }
             }
             generateMap(mapAttempt,roomAttempt, numBats, numPits);
             //printMap(mapAttempt, roomAttempt);
        }
        while(!isPath(mapAttempt, roomAttempt));
        
        Codex codex = new Codex();
        /*for(int i = 0; i < mapAttempt.length; i++){
            for(int j = 0; j < mapAttempt[0].length; j++){
                mapAttempt[i][j].replaceAll("L", "LP");
                if(roomAttempt[i][j].type.equals(roomTypes.EMPTY)){
                    roomAttempt[i][j].isPit = true;
                }
            }
        }*/
        
        map = mapAttempt;
        rooms = roomAttempt;
        
        printMap(map,rooms);
        String out= "";
        for(String[] row: map){
        	for(String room: row){
        		out += room + ",";
        	}
        	out+='\n';
        }
       System.out.print(out);
       return out; 
    }