anchor.diff:  -module(peer_communication).
   
   %% API
  --export([initiate_handshake/4]).
  +-export([initiate_handshake/4, recieve_handshake/1,
  +	 complete_handshake_header/3]).
   -export([send_message/2, recv_message/1,
   	 construct_bitfield/2, destruct_bitfield/2]).
   
  
positive.code: %% API
  %%====================================================================
  %%--------------------------------------------------------------------
  %% Function: recv_message(Message)
  %% Description: Receive a message from a peer and decode it
  %%--------------------------------------------------------------------
  recv_message(Message) ->
  
negative.code: %%  This call is used if we are the initiator of a torrent handshake as
  %%  we then know the peer_id completely.
  %%--------------------------------------------------------------------
  initiate_handshake(Socket, RemotePeerId, LocalPeerId, InfoHash) ->
      BinPeerId = list_to_binary(RemotePeerId),
      % Since we are the initiator, send out this handshake
      Header = build_peer_protocol_header(),
      ok = gen_tcp:send(Socket, Header),
      complete_handshake_header(Socket, InfoHash, LocalPeerId),
      % Now, we wait for his handshake to arrive on the socket
      % Since we are the initiator, he is requested to fire off everything
      % to us.
      case recieve_header(Socket) of
  	{ok, ReservedBytes, IH, PI} ->
  	    if
  		IH /= InfoHash ->
  		    {error, infohash_mismatch};
  		PI /= BinPeerId ->
  