public void add(int x, int y) {
        int[] tmp = new int[2];
        for(int i = 0; i < index; i++)
            if(x < line[i][0] || y < line[index][1]) {
                tmp[0] = line[i][0];
                tmp[1] = line[i][1];
                line[i][0] = x;
                line[i][1] = y;
                x = tmp[0];
                y = tmp[1];
            }
        line[index][0] = x;
        line[index][1] = y;
        index++;
        count++;
    }