   end
 
   defp do_patch_delete(list, diff) do
-    case Enum.split_while(diff, &split_underscore/1) do
+    case Enum.split_with(diff, &split_underscore/1) do
       {[], []} -> {list, diff}
-      {_, []} -> {list, diff}
-      {check, deleted} ->
+      {[], _} -> {list, diff}
+      {deleted, check} ->
         delete_list = Enum.map(deleted, fn
-          {"_" <> s_index, _} -> String.to_integer(s_index)
+          {<<"_", s_index::binary>>, _} -> String.to_integer(s_index)
         end)
 
         filtered_list = Enum.filter(list, fn

  @sentinel :json_diff_ex_sentinal_value

  @spec split_underscore_map({binary, list}) :: boolean
  defp split_underscore_map({<<"_", _::binary>>, [value, 0, 0]}) when is_map(value) do
    false
  end
  defp split_underscore_map(_) do
    true
  end

  @spec split_underscore({binary, list}) :: boolean
  defp split_underscore({<<"_", _::binary>>, [_, 0, 0]}) do
    false
  end

  defp split_underscore(_) do
    true
  end



    end)
    |> Enum.into(%{})
    Map.merge(map1, diff2, fn(_k, v_map, v_diff) ->
      {v_map_compare, v_diff_compare} = correct_lists(v_map, v_diff)
      case v_diff_compare do
        [^v_map_compare, new_value] -> new_value
        new_map when is_map(new_map) ->
          case Map.get(new_map, "_t", false) === "a" do
            true ->
