 
   """
   @spec difference(t, t) :: t
-  def difference(%MapSet{} = set1, %MapSet{} = set2) do
-    reduce(set2, {:cont, set1}, fn value, acc ->
-      {:cont, delete(acc, value)}
-    end) |> elem(1)
+  def difference(%MapSet{map: map1}, %MapSet{map: map2}) do
+    map = :maps.fold(fn value, _, acc ->
+      Map.delete(acc, value)
+    end, map1, map2)
+    %MapSet{map: map}
   end
 
   @doc """

  """
  @spec put(t, value) :: t
  def put(%MapSet{map: map} = set, value) do
    %{set | map: Map.put(map, value, nil)}
  end

  @doc """


  """
  @spec subset?(t, t) :: boolean
  def subset?(%MapSet{map: map1}, %MapSet{map: map2}) do
    if map_size(map1) <= map_size(map2) do
      :maps.fold(fn value, _, _ ->
        if Map.has_key?(map2, value) do
          true
        else
          throw({:halt, false})
        end
      end, true, map1)
    else
      false
    end
  catch
    {:halt, false} -> false
  end

  @doc """
