anchor.diff:  	U1R1Stream2 = lib_json:get_field(Body10,"_id"),
   	
   	%% Add random data between min and max for the streams
  -	random_data(15,-50.0,50.0,U1R1Stream1),
  -	random_data(15,150.0,350.0,U1R1Stream2),
  +	sinus_random_data(15,U1R1Stream1,1000),
  +	sinus_random_data(15,U1R1Stream2,1000),
   	
   	%% Create streams for resource2 for user1
   	{ok, {{_Version11, 200, _ReasonPhrase11}, _Headers11, Body11}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U1Resource2 ++"\",\"name\":\"Stream1\",\"tags\":\"[temperature,celsius,Norrtalje]\",\"description\":\"Temperature in Celsius in Norrtalje\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"celsius\",\"accuracy\":0.95,\"min_val\":-50.0,\"max_val\":50.0,\"active\":\"true\",\"user_ranking\":10.0,\"subscribers\":6,\"last_updated\":\"2013-10-05T010502.0000\", \"creation_date\":\"2013-10-01\",\"history_size\": 5000,\"location\":\"59.7667,18.7000\"}"}, [], []),
  
positive.code: 	U1R2Stream2 = lib_json:get_field(Body12,"_id"),
  	
  	%% Add random data between min and max for the streams
  	random_data(15,-50.0,50.0,U1R2Stream1),
  	random_data(15,150.0,350.0,U1R2Stream2),
  	
  	%% Create streams for resource3 for user1
  	{ok, {{_Version13, 200, _ReasonPhrase13}, _Headers13, Body13}} = httpc:request(post, {"http://localhost:8000/streams", [],"application/json", "{\"resource_id\":\""++ U1Resource3 ++"\",\"name\":\"Stream1\",\"tags\":\"[temperature,celsius,Sala]\",\"description\":\"Temperature in Celsius in Sala\",\"private\":\"false\",\"type\":\"Temperature\",\"unit\":\"celsius\",\"accuracy\":0.95,\"min_val\":-50.0,\"max_val\":50.0,\"active\":\"true\",\"user_ranking\":10.0,\"subscribers\":16,\"last_updated\":\"2013-10-05T010502.0000\", \"creation_date\":\"2013-10-01\",\"history_size\": 5000,\"location\":\"59.9167,16.6000\"}"}, [], []),
  
negative.code: -export([add_data/0]).
  
  %% @doc
  %% Function: sinus_random_data/3
  %% Purpose: Used to add a given amount of datapoints with values
  %%          following the sinus curve with some random noise
  %% Returns: ok 
  %%
  %% Side effects: creates datapoints in elastich search
  %% @end
  -spec sinus_random_data(Amount::integer(),StreamId::string(),Delay::integer()) -> ok.
  
  sinus_random_data(0,_StreamId,_Delay) ->
  	ok;
  sinus_random_data(Amount,StreamId,Delay) ->
  	{A1,A2,A3} = now(),
  	random:seed(A1, A2, A3),
  	{{Year,Month,Day},{Hour,Minute,Second}} = calendar:local_time(),
  	TimeStamp = generate_timestamp([Year,Month,Day,Hour,Minute,Second],0),
  	Value = math:sin(Amount/10.0) + (random:uniform()/10.0),
  	UsedValue = float_to_list(Value,[{decimals,3}]),
  	%% Unsure if this is how the datapoints should look
  	JSON = "{\"stream_id\":\""++ StreamId++"\",\"timestamp\":\"" ++ TimeStamp ++ "\",\"value\":"++ UsedValue ++"}",
  	{ok, {{_Version, _Code, _ReasonPhrase}, _Headers, _Body}} = httpc:request(post, {"http://localhost:8000/streams/" ++ StreamId ++ "/data", [],"application/json", JSON}, [], []),
  	timer:sleep(Delay),
  	sinus_random_data(Amount-1,StreamId,Delay).
  
  
  %% @doc
  %% Function: random_data/2
  %% Purpose: Used to create a timestamp vaild in es
  %%          from the input which should be the list
  %%          [Year,Mount,Day,Hour,Minute,Day]
  %% Returns: The generated timestamp
  %%
  %% @end
  -spec generate_timestamp(DateList::list(),Count::integer()) -> string().
  
  generate_timestamp([],_) ->
  	[];
  generate_timestamp([First|Rest],3) ->
  	case First < 10 of
  		true -> "T0" ++ integer_to_list(First) ++ generate_timestamp(Rest,4);
  		false -> "T" ++ integer_to_list(First) ++ generate_timestamp(Rest,4)
  	end;
  generate_timestamp([First|Rest],Count) ->
  	case First < 10 of
  		true -> "0" ++ integer_to_list(First) ++ generate_timestamp(Rest,Count+1);
  		false -> "" ++ integer_to_list(First) ++ generate_timestamp(Rest,Count+1)
  	end.
  
  %% @doc
  %% Function: add_data/0
  