anchor.diff:  create_stream_query([StreamId|Rest],Acc) ->
   	create_stream_query(Rest," " ++ StreamId ++ Acc).
   
  +
  +%% @doc
  +%% Function: input_to_string/1
  +%% Purpose: Used to create the a string from the input
  +%% Returns: The created string
  +%% @end
  +-spec input_to_string(term()) -> string().
  +
  +input_to_string(Input) when is_list(Input) ->
  +	String = lists:foldr(fun(A,Acc) -> case is_integer(A) of true -> integer_to_list(A) ++","++ Acc; false -> float_to_list(A, [{decimals, 10}, compact]) ++","++ Acc end end,[],Input),
  +	Return = "[" ++ string:substr(String,1,length(String)-1) ++ "]",
  +	erlang:display(Return),
  +	Return;
  +input_to_string(Input) ->
  +	lib_json:to_string(Input).
  +
   %% @doc
   %% Function: get_es_id/2
   %% Purpose: Used to get the id of the document that
  
positive.code: 				{ok,JsonStruct2} -> 
  					Update = case lib_json:field_value_exists(JsonStruct2, "_source.outputlist[*].input", Input) of
  								 true ->
  									 "{\"script\" : \"for(int i=0;i < ctx._source.outputlist.size(); i++){if (ctx._source.outputlist[i].input == newinput && !ctx._source.outputlist[i].output.contains(newoutput)){ctx._source.outputlist[i].output += newoutput; i = ctx._source.outputlist.size();}}\", \"params\":{\"newinput\":" ++  lib_json:to_string(Input)++ ", \"newoutput\":{\"output_id\":\""++Username++"\",\"output_type\":\"user\"}}}";
  								 false ->
  									 "{\"script\" : \"ctx._source.outputlist += newelement\", \"params\":{\"newelement\":{\"input\" : "++ lib_json:to_string(Input) ++ ", \"output\":[{\"output_id\":\""++Username++"\",\"output_type\":\"user\"}]}}}"
  							 end,
  					case api_help:update_doc(?INDEX, "trigger", EsId, Update) of % Update document in es with the new user
  						{error, {Code4, Body4}} -> 
  
negative.code: 				{ok,JsonStruct2} -> 
  					Update = case lib_json:field_value_exists(JsonStruct2, "_source.outputlist[*].input", Input) of
  								 true ->
  									 "{\"script\" : \"for(int i=0;i < ctx._source.outputlist.size(); i++){if (ctx._source.outputlist[i].input == newinput && !ctx._source.outputlist[i].output.contains(newoutput)){ctx._source.outputlist[i].output += newoutput; i = ctx._source.outputlist.size();}}\", \"params\":{\"newinput\":" ++  input_to_string(Input)++ ", \"newoutput\":{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}}}";
  								 false ->
  									 "{\"script\" : \"ctx._source.outputlist += newelement\", \"params\":{\"newelement\":{\"input\" : "++ input_to_string(Input) ++ ", \"output\":[{\"output_id\":[\""++URI++"\",\""++ User++"\"],\"output_type\":\"uri\"}]}}}"
  							 end,
  					case api_help:update_doc(?INDEX, "trigger", EsId, Update) of % Update document in es with the new user
  						{error, {Code4, Body4}} -> 
  