public boolean divide()
    {        
        int regionHeight = y2 - y1;
        int regionWidth = x2 - x1;
        // Millä tavalla alue voidaan jakaa?
        boolean canDivHor = regionHeight >= REGION_MIN_SIZE * 2;
        boolean canDivVer =  regionWidth >= REGION_MIN_SIZE * 2;
        
        // Jos alue on liian pieni sekä korkeudeltaan että leveydeltään, ei sitä voi jakaa ollenkaan
        if (!canDivHor && !canDivVer)
            return false;
        if (!canDivHor)
            horizontalDiv = false;
        else if (!canDivVer)
            horizontalDiv = true;
        else
            horizontalDiv = Main.rand.nextBoolean(); // Jos alue on tarpeeksi iso, voidaan jakaa miten vaan
        
        int dividePoint; // Relatiivinen y- tai x-koordinaatti, jonka perusteella jaetaan alue
        
        if (horizontalDiv)
        {
            dividePoint = getDividePoint(regionHeight);
            subRegion1 = new MapRegion(x1, x2, y1, y1 + dividePoint);
            subRegion2 = new MapRegion(x1, x2, dividePoint + y1, y2);
        }
        else
        {
            dividePoint = getDividePoint(regionWidth);
            subRegion1 = new MapRegion(x1, dividePoint + x1, y1, y2);
            subRegion2 = new MapRegion(dividePoint + x1, x2, y1, y2);
        }
        return true;
    }