public static void flatten3(TreeNode root) {
    	if (root == null || (root.left == null && root.right == null)) return;
		if (root.left != null) {
			TreeNode tmp = root.right;
			root.right = root.left;
			root.left = null;
			TreeNode rightMost = findRightMostNode(root.right);
			rightMost.right = tmp;
			flatten3(root.right);
		} else if (root.right != null) {
			flatten3(root.right);
		}
	}