         @doc "Marks a task as executed"
         def put_task(task, project) do
           item = {task, project}
-          Agent.update(__MODULE__, &Set.put(item, &1))
+          Agent.update(__MODULE__, &Set.put(&1, item))
         end
       end
 

  This is often used to start the agent as part of a supervision tree.

  Once the agent is spawned, the given function is invoked and its return
  value is used as the agent state. Note this function does not return
  until the given function has returned.

  ## Options

  The `:name` option is used for name registered as described in the module
  documentation. If the option `:timeout` option is present, the agent is
  allowed to spend the given milliseconds initializing or it will be terminated
  and the start function will return `{:error, :timeout}`.

  If the option `:debug` is present, the corresponding function in the
  [`:sys` module](http://www.erlang.org/doc/man/sys.html) will be invoked.

  If the option `:spawn_opt` is present, the given options will be passed
  to the underlying process as in `Process.spawn/3`.

  ## Return values

  If the server is successfully created and initialized the function returns
  `{:ok, pid}`, where pid is the pid of the server. If there already exists
  an agent with the specified name the function returns
  `{:error, {:already_started, pid}}` with the pid of that process.

  If the given function callback fails with reason, the function returns
  `{:error, reason}`.
  """
  @spec start_link((() -> term), GenServer.options) :: on_start

  passing the agent state. The function must return the new state.

  A timeout can also be specified (it has a default value of 5000).
  This function always returns `:ok`.
  """
  @spec update(agent, (state -> state)) :: :ok
  def update(agent, fun, timeout \\ 5000) when is_function(fun, 1) do
