     end
   end
 
-  ##################################
-  # Internals
+#--------------------------------------------------------------
+# Internals
 
   defp is_balanced? n do
     (is_black_same n) && (is_red_separate n)

    <> pref <> "+ " <> do_to_string(("  " <> pref), l)
    <> pref <> "+ " <> do_to_string(("  " <> pref), r)

  #############
  defp is_red(%Node{color: :red}), do: true
  defp is_red(_), do: false
  #############

  defp valid tree do
    is_balanced(tree) && black_height(tree) && is_ordered(tree)
  end

  #####################################################################
  ## Basic Operations
  #####################################################################
  ## Insertion
  #  Chris Okasaki


  defp turn_black_with_leaf(Leaf), do: Leaf
  defp turn_black_with_leaf(node), do: turn_black(node)

#--------------------------------------------------------------

  def minimum(%Node{left: Leaf, key: k, value: v}), do: {k, v}
  def minimum(%Node{left: l}), do: minimum(l)
