             Process.send_after(__MODULE__, {:remove, id, :timeout}, ttl)
         end
       else # reply error, but dont cache it
-        GenServer.cast(__MODULE__, {:remove, id, :exit})
+        GenServer.cast(__MODULE__, {:remove, id, val})
       end
-      # Logger.debug("Calculated value #{inspect {id, val}}")
       val
     else
-      # Logger.debug("From cache 2  #{inspect {id, val}}")
       val
     end
   end

  def handle_cast({:insert, id, value}, status) do
    :ets.insert(__MODULE__, {id, value})

    # Logger.debug("Got answer for #{inspect id} -> #{inspect value}: #{inspect status[id]}")
    Enum.map(status[id], fn from ->
      GenServer.reply(from, value)
    end)

        prev_from = Map.get(status,id, nil)
        if prev_from == nil do # the first calculates the value
          status = Map.put(status, id, [] )
          # Logger.debug("No answer, you do it #{inspect id} #{inspect status}")
          {:reply, :youdoit, status}
        else
          # Logger.debug("No anwser, wait for it #{inspect status[id]}")
          status = Map.put(status, id, [from | prev_from] )
          {:noreply, status}
        end
