private STNode<Key, Value> deleteMax(STNode<Key, Value> x)
	{
		STNode<Key, Value> savedRoot = x;

		STNode<Key, Value> p = null;
		while (x.right != null)
		{
			p = x;
			p.N--;
			x = x.right;
		}

		if (p == null)
		{
			root = null;
			return root;
		}

		p.right = null;
		if (p.left == null) // adjust height
		{
			x = savedRoot;
			while (x != null)
			{
				x.h--;
				x = x.right;
			}
		}
		
		return savedRoot;
	}