void createLevel(int[] level) {
            int levelCount = 1;
            int topIndex = 1;
            int i = 1;
            while(i < region[0]) {

                int top = region[i + 1];
                int bottom = region[i + 3] + 1;
                int j = topIndex;

                addTop: {
                    while(j < levelCount) {
                        if (level[j] == top) {
                            break addTop;
                        }
                        if (level[j] > top) {
                            System.arraycopy(level, j, level, j + 1, levelCount - j);
                            break;
                        }
                        j++;
                    }

                    level[j] = top;
                    levelCount++;
                    topIndex = j;
                }

                addBottom: {
                    while(j < levelCount) {
                        if (level[j] == bottom) {
                            break addBottom;
                        }
                        if (level[j] > bottom) {
                            System.arraycopy(level, j, level, j + 1, levelCount - j);
                            break;
                        }
                        j++;
                    };

                    level[j] = bottom;
                    levelCount++;
                }

                i += 4;
            }
            level[0] = levelCount;
        }