void balance(Entry<V> x) {
	        Entry<V> y;
	        x.color = true;
	        while (x != root && x.parent.color) {
	            if (x.parent == x.parent.parent.left) {
	                y = x.parent.parent.right;
	                if (y != null && y.color) {
	                    x.parent.color = false;
	                    y.color = false;
	                    x.parent.parent.color = true;
	                    x = x.parent.parent;
	                } else {
	                    if (x == x.parent.right) {
	                        x = x.parent;
	                        leftRotate(x);
	                    }
	                    x.parent.color = false;
	                    x.parent.parent.color = true;
	                    rightRotate(x.parent.parent);
	                }
	            } else {
	                y = x.parent.parent.left;
	                if (y != null && y.color) {
	                    x.parent.color = false;
	                    y.color = false;
	                    x.parent.parent.color = true;
	                    x = x.parent.parent;
	                } else {
	                    if (x == x.parent.left) {
	                        x = x.parent;
	                        rightRotate(x);
	                    }
	                    x.parent.color = false;
	                    x.parent.parent.color = true;
	                    leftRotate(x.parent.parent);
	                }
	            }
	        }
	        root.color = false;
	    }