     pids
     |> Enum.flat_map(fn pid ->
       receive do
-        {:freq, freq} -> freq
+        {:freq, ^pid, freq} -> freq
       end
     end)
     |> Enum.reduce(%{}, fn {k, c}, m ->

  defmodule Worker do
    def loop do
      receive do
        {:calc, sender, text} -> send sender, {:freq, calc(text)}
        _ -> IO.puts "unknown"
      end
    end

    Enum.map(chunked_texts, fn chunked_texts ->
      pid = spawn_link(Worker, :loop, [])
      send pid, {:calc, self, chunked_texts}
      pid
    end)
  end

