private void partition() {
        // We've already split this space. No worries, carry on.
        if(!isLeaf()) {
            return;
        }

        assert nodes == null;

        final float nodeWidth;
        final float nodeHeight;

        if(width > height) {
            nodeWidth  = width * tree.maxScaleRatio;
            nodeHeight = height * tree.minScaleRatio;
        } else {
            nodeWidth  = width * tree.minScaleRatio;
            nodeHeight = height * tree.maxScaleRatio;
        }

        final int xSteps = (int) Math.ceil(width / nodeWidth);
        final int ySteps = (int) Math.ceil(height / nodeHeight);

        //System.out.println("x:" + xSteps + ", y:" + ySteps);

        nodes = new Space[xSteps * ySteps];

        short i = 0;
        for(short xIndex = 0; xIndex < xSteps; ++xIndex) {
            for(short yIndex = 0; yIndex < ySteps; ++yIndex, ++i) {
                float xOffset = x + xIndex * nodeWidth;
                float yOffset = y + yIndex * nodeHeight;

                nodes[i] = new Space(tree, xOffset, yOffset, nodeWidth , nodeHeight);
                //System.out.println("node created: " + nodes[i]);
            }
        }
    }