anchor.diff:  	ets:new(topic_subscriber, [bag, named_table, {keypos, 2}]),
   	{ok, #state{}}.
   
  -handle_call({subscribe, {Topic, Qos}, SubPid}, _From, State) ->
  -	case mnesia:transaction(fun trie_add/1, [Topic]) of
  -	{atomic, _} ->	
  -		case get({subscriber, SubPid}) of
  -		undefined -> 
  -			MonRef = erlang:monitor(process, SubPid),
  -			put({subcriber, SubPid}, MonRef),
  -			put({submon, MonRef}, SubPid);
  -		_ ->
  -			already_monitored
  -		end,
  -		ets:insert(topic_subscriber, #topic_subscriber{topic=Topic, qos = Qos, subpid=SubPid}),
  -		{reply, ok, State};
  -	{aborted, Reason} ->
  -		{reply, {error, Reason}, State}
  -	end;
  +handle_call({subscribe, Topics, SubPid}, _From, State) ->
  +    Result = [subscribe_topic({Topic, Qos}, SubPid) || {Topic, Qos} <- Topics],
  +    Reply = 
  +    case [Err || Err = {error, _} <- Result] of
  +        [] -> {ok, [Qos || {ok, Qos} <- Result]};
  +        Errors -> hd(Errors)
  +    end,
  +    {reply, Reply, State};
   
   handle_call(Req, _From, State) ->
   	{stop, {badreq, Req}, State}.
   
  -handle_cast({unsubscribe, Topic, SubPid}, State) ->
  -	ets:match_delete(topic_subscriber, #topic_subscriber{topic=Topic, qos ='_', subpid=SubPid}),
  -	try_remove_topic(Topic),
  +handle_cast({unsubscribe, Topics, SubPid}, State) ->
  +    lists:foreach(fun(Topic) -> 
  +        ets:match_delete(topic_subscriber, #topic_subscriber{topic=Topic, qos ='_', subpid=SubPid}),
  +        try_remove_topic(Topic)
  +    end, Topics),
   	{noreply, State};
   
   handle_cast(Msg, State) ->
  
positive.code: %% ------------------------------------------------------------------
  %% Internal Function Definitions
  %% ------------------------------------------------------------------
  try_remove_topic(Name) when is_binary(Name) ->
  	case ets:member(topic_subscriber, Name) of
  	false -> 
  
negative.code: %%
  %% @doc All topics
  %%
  topics() ->
  	mnesia:dirty_all_keys(topic).
  
  %%
  %% @doc Subscribe Topic or Topics
  %%
  subscribe({Topic, Qos}, SubPid) when is_binary(Topic) and is_pid(SubPid) ->
      subscribe([{Topic, Qos}], SubPid);
  
  subscribe(Topics, SubPid) when is_list(Topics) and is_pid(SubPid) ->
      gen_server:call(?SERVER, {subscribe, Topics, SubPid}).
  
  %%
  %% @doc Unsubscribe Topic or Topics
  %%
  unsubscribe(Topic, SubPid) when is_binary(Topic) and is_pid(SubPid) ->
      unsubscribe([Topic], SubPid);
  
  unsubscribe(Topics, SubPid) when is_list(Topics) and is_pid(SubPid) ->
  	gen_server:cast(?SERVER, {unsubscribe, Topics, SubPid}).
  
  %%
  %% @doc Publish to cluster node.
  