anchor.diff:  				  InfoHash),
       S#state{managed_pids = dict:store(Pid, PeerId, S#state.managed_pids)}.
   
  -socket_connect(Pid, IP, Port) ->
  +socket_connect(Pid, IP, Port, PeerId, InfoHash) ->
       {ok, Sock} = gen_tcp:connect(IP, Port, [binary, {active, false}]),
  -    gen_server:cast(Pid, {connect, Sock}),
  +    {ok, HisPeerId} = peer_communication:recv_handshake(Sock,
  +							PeerId,
  +							InfoHash),
  +    gen_server:cast(Pid, {connect, Sock, HisPeerId}),
       exit(normal).
   
  -spawn_socket_connect(IP, Port) ->
  -    spawn(connection_manager, socket_connect, [self(), IP, Port]).
  +spawn_socket_connect(IP, Port, S) ->
  +    spawn(connection_manager, socket_connect, [self(), IP, Port,
  +					       S#state.peerid,
  +					       S#state.infohash]).
  
positive.code:     {ok, State}.
  
  handle_cast({new_ip, Port, IP}, S) ->
      spawn_socket_connect(IP, Port),
      {noreply, S};
  handle_cast({is_interested, PeerId}, State) ->
      [{_, _, Choke}] = ets:lookup(State, PeerId),
      {noreply, ets:insert_new(State, {PeerId, interested, Choke})};
  
negative.code: 
  -export([handle_call/3, init/1, terminate/2, code_change/3, handle_info/2, handle_cast/2]).
  
  -export([is_interested/2, is_not_interested/2, start_link/3,
  	 spawn_new_torrent/6]).
  
  -export([socket_connect/5]).
  
  -record(state, {state_table = none,
  		filesystem = none,
  		peerid = none,
  		infohash = none,
  		managed_pids = none}).
  
  start_link(FileSystemPid, PeerId, InfoHash) ->
      gen_server:start_link(connection_manager,
  			  {FileSystemPid, PeerId, InfoHash}, []).
  
  init({FileSystemPid, PeerId, InfoHash}) ->
      {ok, #state{state_table = ets:new(connection_table, []),
  		filesystem = FileSystemPid,
  		peerid = PeerId,
  		infohash = InfoHash,
  		managed_pids = dict:new()}}.
  
  handle_info({'EXIT', Who, Reason}, S) ->
  