     {:noreply, new_state}
   end
 
+  def handle_info(task_result, state) do
+    task_result
+    |> IO.inspect
+    {:noreply, state}
+  end
+
   ## Private
 
   defp retrieve(key) do

          state = state |> Map.put(:connected, true)

          # Parse new blocks when they arrived
          unless retrieve(:block_cnt) == block_cnt do
            # Parse
            parse_new_blocks!(block_cnt)
            |> Enum.map(&(&1.txns))
            |> List.flatten
            |> Enum.map(&(&1 |> RPC.gettransaction!))
            |> Enum.map(&(&1.outputs))
            |> List.flatten
            |> Enum.filter_map(
              fn(o) -> o.value > 0 end,
              fn(o) ->
                parsed = o |> Script.parse_address
                case parsed do
                  {:ok, addr} -> %{address: Address.base58check(addr), value: o.value}
                  other -> other
                end
              end)
            |> IO.inspect
            # Store
            block_cnt |> store(:block_cnt)
          end

          # Return state

    Agent.update(@agent_name, &Map.put(&1, key, value))
  end

  defp parse_blocks!(low, high) do
    hash = :rpc |> Gold.getblockhash!(high)
    block = :rpc |> Gold.getblock!(hash)
    [block] |> parse_blocks!(low, high)
  end

  defp parse_blocks!(blocks, low, high) do
    [prev_block | _] = blocks
    block = :rpc |> Gold.getblock!(prev_block.previousblockhash)

    cnt = blocks |> Enum.count
    div = cnt/100
    if (Float.ceil(div) == div) do
      IO.puts cnt
    end

    block |> process_block

    unless (block.height == low) do
      [block | blocks] |> parse_blocks!(low, high)
    else
      [block | blocks]
    end
  end

  defp process_block(block) do
    task = @tasksup_name
    |> Task.Supervisor.async(fn () ->
      outputs = block.txns
      |> Enum.map(&(&1 |> RPC.gettransaction!))
      |> Enum.map(&(&1.outputs))
      |> List.flatten
      |> Enum.filter_map(
        fn(o) -> o.value > 0 end,
        fn(o) ->
          parsed = o |> Script.parse_address
          case parsed do
            {:ok, addr} -> %{address: Address.base58check(addr), value: o.value}
            other -> other
          end
        end)
      %{height: block.height, outputs: outputs}
    end)
  end

end
