anchor.diff:  	{running, _} ->
   	    S = mote_read(Handler, Mote),
   	    NS = Acc++S,
  -	    case re:run(NS, Msg) of
  -		{match, _} ->
  -		    NS;
  -		nomatch ->
  +	    case re:run(NS, "DEBUG.*\n") of
  +		{match, [{_, End}]} ->
  +		    io:format("~s", [NS]),
   		    ok = simulation_step_ms(Handler),
  -		    wait_for_result(Handler, Mote, T-1, Msg, NS)
  +		    wait_for_result(Handler, Mote, T-1, Msg, string:substr(NS, End+1));
  +		_ ->
  +		    case re:run(NS, Msg) of
  +			{match, _} ->
  +			    NS;
  +			nomatch ->
  +			    ok = simulation_step_ms(Handler),
  +			    wait_for_result(Handler, Mote, T-1, Msg, NS)
  +		    end
   	    end;
   	_ -> 
   	    undef
  
positive.code: 	{running, _} ->
  	    S = mote_read(Handler, Receiver),
  	    NS = Acc++S,
  	    case re:run(NS, Msg) of
  		{match, _} ->
  		    true;
  		nomatch ->
  		    ok = simulation_step_ms(Handler),
  		    wait_for_msg(Handler, Receiver, T-1, Msg, NS)
  	    end;
  	_ ->
  	    false
  
negative.code: 	    ok
      end.
  
  %% nifty functions
  alloc(Handler, Mote, Size) ->
      alloc(Handler, Mote, Size, 1000).
  
  