     formatter = fn
       {key, val} when keywords? ->
         format_key_value(key, val, true)
+
       elem ->
         inspect(elem)
     end
+
     {kind, Enum.map_join(elems, ", ", formatter)}
   end
 

    {surplus, altered, missing, same} = map_difference(left, right)

    keywords? =
      Inspect.List.keyword?(surplus) and
      Inspect.List.keyword?(altered) and
      Inspect.List.keyword?(missing) and
      Inspect.List.keyword?(same)

    result = Enum.reduce(missing, [], fn({key, val}, acc) ->
      map_pair = format_key_value(key, val, keywords?)
      [[ins: ", ", ins: map_pair] | acc]
    end)
    result =
      if same == [] and altered == [] and missing != [] and surplus != [] do
        [[_ | elem_diff] | rest] = result


    if proper1? and proper2? do
      initial_path = {0, 0, list1, list2, []}

      result =
        find_script(0, length1 + length2, [initial_path], keywords?)
        |> format_each_fragment([], keywords?)

      [{:eq, "["}, result, {:eq, "]"}]
    else
      script_list(list1, list2, [])
    end
  end

  defp format_each_fragment([{:diff, script}], [], _keywords?), do: script

  defp format_each_fragment([{kind, elems}], [], keywords?),
    do: [format_fragment(kind, elems, keywords?)]
