 
         for (plane, range) in rangesByPlane {
             let width = (roomWidth + roomSpacingWidth) * (range.to.x - range.from.x + 1)
-            let height = (roomHeight + roomSpacingHeight) * (range.to.y - range.from.y + 1)
+            let height = roomHeight * (range.to.y - range.from.y + 1) + roomSpacingHeight * (range.to.y - range.from.y)
             renderedMap[plane] = [[Character]](repeating: [Character](repeating: fillCharacter, count: width), count: height)
         }
 


            switch element {
            case .room(let room) where room.exits[direction] != nil:
                fallthrough
            case .passage(axis):
                for fillCoordinate in fillRange {
                    var position = oldPosition


        for y in from.y..<to.y {
            fragment += String(map[y][from.x..<to.x])
            if y != to.y - 1 {
                fragment += "\n"
            }
        }

        return fragment
