private void recursivePrint(int i, Node parentNode, int parentPosition, int depthLeft, int depthRight) {

        int newLeftPosition = 2 * i + 1;
        Pair left = null;
        Node nodeLeft = null;
        int parentLeftPosition = parentPosition;
        if (newLeftPosition < nodes.length) {
            left = nodes[newLeftPosition];
            parentLeftPosition = getRectNextLeft(parentLeftPosition, heightFromLeft(i));
            if (parentNode != null) {
                depthLeft++;
                nodeLeft = makeNode("&lt;" + left.p + "," + left.v + "&gt;", new Point(parentLeftPosition, getRectNextTop(depthLeft)), Node.COLOR_LEFT, newLeftPosition);
                nodeLeft.setParent(parentNode);
            }
        }

        int newRightPosition = 2 * i + 2;
        Pair right = null;
        Node nodeRight = null;
        int parentRightPosition = parentPosition;
        if (newRightPosition < nodes.length) {
            right = nodes[newRightPosition];
            parentRightPosition = getRectNextRight(parentRightPosition, heightFromRight(i));
            if (parentNode != null) {
                depthRight++;
                nodeRight = makeNode("&lt;" + right.p + "," + right.v + "&gt;", new Point(parentRightPosition, getRectNextTop(depthRight)), Node.COLOR_RIGHT, newRightPosition);
                nodeRight.setParent(parentNode);
            }
        }

        if (left != null) {
            recursivePrint(newLeftPosition, nodeLeft, parentLeftPosition, depthLeft, depthRight);
        }
        if (right != null) {
            recursivePrint(newRightPosition, nodeRight, parentRightPosition, depthLeft, depthRight);
        }
    }