void rightRotate(RedBlackNode y)
    {
    	RedBlackNode x = y.left;		// set x
    	y.left = x.right;				// turn x's right subtree into y's left subtree
    	if(x.right != nil)
    		x.right.parent = y;
    	x.parent = y.parent;			// link y's parent to x
    	if(y.parent == nil)
    		root = x; 
    	else if (y == y.parent.left)
    		y.parent.left = x;
    	else
    		y.parent.right = x;
    	x.right = y;					// put y on x's right
    	y.parent = x;
    }