anchor.diff:      %% Etorrent
       application:start(etorrent, permanent).
   
  +%% @doc Application callback.
  +%% @end
   start(_Type, _Args) ->
       PeerId = generate_peer_id(),
       {ok, Pid} = etorrent_sup:start_link(PeerId),
       {ok, Pid}.
   
  +%% @doc Application callback.
  +%% @end
   stop() ->
       ok = application:stop(etorrent).
   
  +%% @doc Application callback.
  +%% @end
   prep_stop(_S) ->
       io:format("Shutting down etorrent~n"),
       ok.
   
  +%% @doc Application callback.
  +%% @end
   stop(_State) ->
       ok.
   
  -%%--------------------------------------------------------------------
  -%% Function: list() -> io()
  -%% Description: List currently active torrents.
  -%%--------------------------------------------------------------------
  +%% @doc List currently active torrents.
  +%% <p>This function will list the torrent files which are currently in
  +%% the active state in the etorrent system. A general breakdown of each
  +%% torrent and its current states is given. The function is given as a
  +%% convenience in the shell while the system is running.</p>
  +%% @end
  +-spec list() -> ok.
   list() ->
       A = etorrent_torrent:all(),
       {DownloadRate, UploadRate} = etorrent_rate_mgr:global_rate(),
  
positive.code:     ok.
  
  %%--------------------------------------------------------------------
  %% Abbreviations
  %%--------------------------------------------------------------------
  h() -> help().
  l() -> list().
  s() -> show().
  s(Item) -> show(Item).
  
  %% --------------------------------------------------------------------
  %% Internal functions
  %% --------------------------------------------------------------------
  percent_complete(R) ->
      %% left / complete * 100 = % done
      (R#torrent.total - R#torrent.left) / R#torrent.total * 100.
  
  generate_peer_id() ->
      Number = crypto:rand_uniform(0, ?RANDOM_MAX_SIZE),
      Rand = io_lib:fwrite("~B----------", [Number]),
  
negative.code: -export([stop/0, start/0]).
  -export([start/2, stop/1, prep_stop/1]).
  -export([help/0, h/0, list/0, l/0, show/0, s/0, show/1, s/1, check/1]).
  
  -ignore_xref([{h, 0}, {l, 0}, {'prep_stop', 1}, {s, 0}, {s,1}, {stop, 0},
                {check, 1}, {start, 0}]).
  
  -define(RANDOM_MAX_SIZE, 999999999999).
  
  %% @doc Start up the etorrent application.
  %% <p>This is the main entry point for the etorrent application.
  %% It will be ensured that needed apps are correctly up and running,
  %% and then the etorrent application will be started as a permanent app
  %% in the VM.</p>
  %% @end
  start() ->
      %% Start dependent applications
      Fun = fun(Application) ->
  