anchor.diff:  	    end,
       Reply.
   
  -shutdown_math_server() ->
  -    case whereis(?MathServer) of
  -    	undefined -> 
  -    	    true;
  -    	Pid ->
  -    	    case is_process_alive(Pid) of
  -    		true ->
  -		    ?MathServer ! stop,
  -		    unregister(?MathServer);
  -    		false ->
  -    		    unregister(?MathServer)
  -    	    end
  +init(F) ->
  +    loop(F).
  +
  +stop(RegName) ->
  +    stop(whereis(RegName), RegName).
  +
  +stop(undefined, _RegName) ->
  +    ok;
  +stop(Pid, RegName) ->
  +    case is_process_alive(Pid) of
  +	true ->
  +	    send_stop_protocol(RegName);
  +	false ->
  +	    ok
       end.
   
  -init(F) ->
  -    loop(F).
  +send_stop_protocol(RegName) ->
  +   RegName ! stop.
   
   loop(F) ->
       receive
  
positive.code:     register(?MathServer, spawn(?MODULE, init, [fun geometry:areas/1])).
  
  stop() ->
      shutdown_math_server().
  
  call(Shapes) ->
      ?MathServer ! {request, self(), Shapes},
  
negative.code: 		    From ! {response, error, Bad},
  		    loop(F)
  	    end
      after 3000 ->
  	    io:format("Timeout. Server shutdown.~n", []),
  	    exit(timeout)
  	end.
  