 			if key == z.key {
 				return z
 			}
-			z = key < z.key ? z.left : z.right
+			z = key < z.key as Key ? z.left : z.right
 		}
 		return sentinel
 	}

public func +<Key : Comparable, Value>(lhs: RedBlackTree<Key, Value>, rhs: RedBlackTree<Key, Value>) -> RedBlackTree<Key, Value> {
	var t = lhs
	for (k, v) in rhs {
		t.insert(k, value: v)
	}
	return t
}

public func +=<Key : Comparable, Value>(lhs: inout RedBlackTree<Key, Value>, rhs: RedBlackTree<Key, Value>) {
	for (k, v) in rhs {
		lhs.insert(k, value: v)
	}
}

public func -<Key : Comparable, Value>(lhs: RedBlackTree<Key, Value>, rhs: RedBlackTree<Key, Value>) -> RedBlackTree<Key, Value> {
	var t = rhs
	for (k, _) in rhs {
		t.removeValueForKeys(k)
	}
	return t
}

public func -=<Key : Comparable, Value>(lhs: inout RedBlackTree<Key, Value>, rhs: RedBlackTree<Key, Value>) {
	for (k, _) in rhs {
		lhs.removeValueForKeys(k)
	}
}

		while x !== sentinel {
			y = x
			y.order += 1
			x = key < x.key as Key ? x.left : x.right
		}

		let z = RedBlackNode<Key, Value>(parent: y, sentinel: sentinel, key: key, value: value)

		if y == sentinel {
			root = z
		} else if key < y.key as Key {
			y.left = z
		} else {
			y.right = z
