 
   defp do_filter({key, value, iter}, fun) do
     if fun.({key, value}) do
-      [{key, value} | do_filter(next(iter), fun)]
+      [{key, value} | do_filter(:maps.next(iter), fun)]
     else
-      do_filter(next(iter), fun)
+      do_filter(:maps.next(iter), fun)
     end
   end
 

  @doc since: "1.13.0"
  @spec reject(map, ({key, value} -> as_boolean(term))) :: map
  def reject(map, fun) when is_map(map) and is_function(fun, 1) do
    iter = iterator(map)
    next = next(iter)
    :maps.from_list(do_reject(next, fun))
  end


  @doc since: "1.13.0"
  @spec filter(map, ({key, value} -> as_boolean(term))) :: map
  def filter(map, fun) when is_map(map) and is_function(fun, 1) do
    iter = :maps.iterator(map)
    next = :maps.next(iter)
    :maps.from_list(do_filter(next, fun))
  end

