anchor.diff:  -export([handle_info/2, code_change/3]).
   -export([start_torrent/2, stop_torrent/1]).
   
  -%% Callbacks
  +%% API
   start_link() ->
       gen_server:start_link({local, torrent_manager}, torrent_manager, [], []).
   
  +start_torrent(File, Torrent) ->
  +    gen_server:cast(torrent_manager, {start_torrent, File, Torrent}).
  +
  +stop_torrent(File) ->
  +    gen_server:cast(torrent_manager, {stop_torrent, File}).
  +
  +%% Callbacks
   init(_Args) ->
       io:format("Spawning torrent manager~n"),
       {ok, {ets:new(torrent_tracking_table, [named_table]), generate_peer_id()}}.
  
positive.code:     {ok, State}.
  
  handle_info({'EXIT', Pid, Reason}, {TrackingMap, PeerId}) ->
      error_logger:error_report([{'Torrent EXIT', Reason}, {'State', {TrackingMap, PeerId}}]),
      [{File, Torrent}] = ets:match(TrackingMap, {Pid, '$1', '$2'}),
      ets:delete(TrackingMap, Pid),
      spawn_new_torrent(File, Torrent, PeerId, TrackingMap),
  
negative.code: handle_cast({start_torrent, F, Torrent}, {TrackingMap, PeerId}) ->
      spawn_new_torrent(F, Torrent, PeerId, TrackingMap),
      {noreply, {TrackingMap, PeerId}};
  
  handle_cast({stop_torrent, F}, {TrackingMap, PeerId}) ->
      TorrentPid = ets:lookup(TrackingMap, F),
      torrent:stop(TorrentPid),
      ets:delete(TrackingMap, F),
      {noreply, {TrackingMap, PeerId}}.
  
  %% Internal functions
  spawn_new_torrent(F, Torrent, PeerId, TrackingMap) ->
      {ok, TorrentPid} = torrent:start_link(F, Torrent, PeerId),
      ets:insert(TrackingMap, {TorrentPid, F, Torrent}),
      torrent:start(TorrentPid).
  
  %% Utility
  generate_peer_id() ->
      Prefix = string:join(string:join("-ET", ?VERSION), "-"),
      Rand = 
  
  