public Room newRandomCorridor() {
        Room newCorridor = null;

        Cell theDoor = (Cell) chooseRandom(mapFreeWalls);

        int offsetX = 0;
        int offsetY = 0;
        int doorX = theDoor.getX(), doorY = theDoor.getY();
        // East
        if (getTile(doorX + 1, doorY) == TILE_EMPTY) {
            offsetX = 1;
        }
        // West
        else if (getTile(doorX - 1, doorY) == TILE_EMPTY) {
            offsetX = -1;
        }
        // North
        else if (getTile(doorX, doorY - 1) == TILE_EMPTY) {
            offsetY = -1;
        }
        // South
        else if (getTile(doorX, doorY + 1) == TILE_EMPTY) {
            offsetY = 1;
        }

        if (offsetX == 0 && offsetY == 0) {
            mapFreeWalls.remove(theDoor);
        } else {
            newCorridor = makeCorridor(theDoor.getX(), theDoor.getY(), offsetX, offsetY);
            if (newCorridor != null) {
                setTile(theDoor.getX(), theDoor.getY(), TILE_DOOR);
                mapFreeWalls.remove(theDoor);

                // Turn top and bottom walls of the door to corners
                if (offsetX == 1 || offsetX == -1) {
                    setTile(theDoor.getX(), theDoor.getY() - 1, TILE_WALL_CORNER);
                    mapFreeWalls.remove(new Cell(theDoor.getX(), theDoor.getY() - 1));
                    setTile(theDoor.getX(), theDoor.getY() + 1, TILE_WALL_CORNER);
                    mapFreeWalls.remove(new Cell(theDoor.getX(), theDoor.getY() + 1));
                }
                // Turn left and right walls of the door to corners
                else {
                    setTile(theDoor.getX() - 1, theDoor.getY(), TILE_WALL_CORNER);
                    mapFreeWalls.remove(new Cell(theDoor.getX() - 1, theDoor.getY()));
                    setTile(theDoor.getX() + 1, theDoor.getY(), TILE_WALL_CORNER);
                    mapFreeWalls.remove(new Cell(theDoor.getX() + 1, theDoor.getY()));
                }

            }
        }

        return newCorridor;
    }