public function removeMin()
{
$t = $this;
if ($t->isRoot() && !$this->isRed($t->left()) && !$this->isRed($t->right())) {
$t = $this->flipToRed($t);
}
$t = $this->removeMinIn($t);
if ($t->isRoot() && $t->isEmpty()) {
$t = $this->flipToBlack($t);
}
return $t;
}