anchor.diff:  stop(Pid) ->
       gen_server:cast(Pid, stop).
   
  +read_piece(Pid, Pn) ->
  +    gen_server:call(Pid, {read_piece, Pn}).
  +
  +write_piece(Pid, Pn, Data) ->
  +    gen_server:call(Pid, {write_piece, Pn, Data}).
  +
   %%====================================================================
   %% gen_server callbacks
   %%====================================================================
  
positive.code: -behaviour(gen_server).
  
  %% API
  -export([start_link/1, stop/1]).
  
  %% gen_server callbacks
  -export([init/1, handle_call/3, handle_cast/2, handle_info/2,
  
negative.code:     {ok, #state{file_dict = FileDict,
  	        file_process_dict = dict:new() }}.
  
  handle_call({read_piece, PieceNum}, _From, S) ->
      {_Hash, FilesToRead} = dict:fetch(PieceNum, S#state.file_dict),
      {ok, Data, NS} = read_pieces_and_assemble(FilesToRead, [], S),
      {reply, {ok, Data}, NS};
  handle_call({write_piece, PieceNum, Data}, _From, S) ->
      {_Hash, FilesToWrite} = dict:fetch(PieceNum, S#state.file_dict),
      {ok, NS} = write_piece_data(Data, FilesToWrite, S),
      {reply, ok, NS}.
  
  handle_cast(stop, S) ->
      {stop, normal, S};
  