   return next
 }
 
-class Candy {
+class BinaryTree {
   var value: Int
-  var R: Candy?
-  var L: Candy?
-  var parent: Candy?
+  var R: BinaryTree?
+  var L: BinaryTree?
+  var parent: BinaryTree?
   var count: Int
 
-  init(_ v: Int, _ p: Candy? = nil) {
+  init(_ v: Int, _ p: BinaryTree? = nil) {
     self.value = v
     self.count = 1
     self.parent = p

      return left
    }
  }
  func maximum() -> Candy {
    if let r = self.R {
      return r.maximum()
    }
    return self
  }
  func replace(tree: Candy, with: Candy?) {
    if tree.value == self.R?.value {
      self.R = with
      with?.parent = self.R

      if let l = self.L {
        l.insert(n)
      } else {
        self.L = BinaryTree(n, self)
      }
    } else if n == self.value {
      self.count += 1
