anchor.diff:  			  buffer = [ C | Buffer ],
   			  escaped = false
   			 } ).
  +    
  +extract_json(Buf, PST, Acc) ->
  +    case count_brackets(Buf, PST) of
  +	{ complete, Processed, NPST} ->
  +	    io:format("Trying again~n"),
  +	    extract_json([], NPST, [ Processed | Acc]);
  +
  +
  +	{ incomplete, NPST} ->
  +	    io:format("Incomplete~n"),
  +	    { Acc, NPST }
  +    end.
  +
  +extract_json(Buf, PST) ->
  +    extract_json(Buf, PST,[]).
  
positive.code: %%%===================================================================
  
  
  count_brackets([${ | Rem], 
  	       #pst { 
  		  buffer = Buffer, 
  
negative.code:     ?debug("~p:handle_info(data): Data: ~p", [ ?MODULE, Data]),
      ?debug("~p:handle_info(data): From: ~p:~p ", [ ?MODULE, IP, Port]),
  
      case extract_json(Data, PST) of
  	{ [], NPST } ->
  	    ?debug("~p:handle_info(data incomplete)", [ ?MODULE]),
  	    inet:setopts(Sock, [{active, once}]),
  	    {noreply, State#st { pst = NPST} };
  
  	{ JSONElements, NPST } ->
  	    ?debug("~p:handle_info(data complete): Processed: ~p", [ ?MODULE, JSONElements]),
  	    FromPid = self(),
  	    spawn(fun() -> [ Mod:Fun(FromPid, IP, Port, 
  				     data, SingleElem, Arg) || SingleElem <- JSONElements ]
  		  end),
  	    inet:setopts(Sock, [ { active, once } ]),
  	    {noreply, State#st { pst = NPST} }
      end;
  