anchor.diff:                        S#series{values=process_series_values(S#series.values, fun(X) -> X + Offset end)}
                 end, Series);
   
  +% offsetToZero
  +evaluate_call(<<"offsetToZero">>, [Series], _From, _Until, _Now) ->
  +    lists:map(fun(S) ->
  +                      Values = S#series.values,
  +                      Minimum = safe_minimum(Values),
  +                      S#series{values=process_series_values(Values, fun(X) -> X - Minimum end)}
  +              end, Series);
  +
   % removeAboveValue
   evaluate_call(<<"removeAboveValue">>, [Series, Val], _From, _Until, _Now) when is_number(Val) ->
       lists:map(fun(S) ->
  
positive.code: 
  safe_minimum([]) -> null;
  safe_minimum(Values) ->
      safe_minimum(Values, 0).
  
  safe_minimum([], Min) -> Min;
  safe_minimum([{_TS, null} | Vs], Min) ->
      safe_minimum(Vs, Min);
  safe_minimum([{_TS, Value} | Vs], Min) ->
      safe_minimum(Vs, min(Min, Value));
  safe_minimum([null | Vs], Min) ->
      safe_minimum(Vs, Min);
  safe_minimum([Value | Vs], Min) ->
      safe_minimum(Vs, min(Min, Value)).
  
  
  square_sum([]) -> 0;
  
negative.code:      ?_assertEqual(S3, evaluate_call(<<"mostDeviant">>, [Series, 1], 0, 0, 0))
      ].
  
  offset_to_zero_test_() ->
      Series = pseudo_series([102, 101, 104, 101, 100, 111]),
      Expected = pseudo_series([2, 1, 4, 1, 0, 11]),
      [?_assertEqual(Expected, evaluate_call(<<"offsetToZero">>, [Series], 0, 0, 0))].
  
  sort_non_null_test_() ->
      [?_assertEqual({[], 0}, sort_non_null([])),
       ?_assertEqual({[], 0}, sort_non_null([null, null])),
  