anchor.diff:                          n_events=NEvents,
                           nums=incr_below(Value, State#state.nums),
                           high_trending=HighTrending,
  -                        n_above_max= case Value =< HighValue of 
  +                        n_above_max=case Value =< HighValue of 
                                           true -> State#state.n_above_max;
                                           false -> State#state.n_above_max+1
  -                                     end
  +                                    end
                       }
               end;
           _ ->
  
positive.code:     
      incr_below(V, [{N,BelowN}|Ns], Acc) when V =< N ->
          incr_below(V, Ns, [{N,BelowN+1}|Acc]);
      incr_below(_, Ns, Acc) ->
          lists:reverse(Acc, Ns).
  
  
  % Replace the sample count with the number of samples below the value.
  
negative.code:                         true ->
                              State1 = State#state{
                                  n_events=NEvents,
                                  high_trending=HighTrending,
                                  new_nums=incr(Value, State#state.new_nums)
                              };
                          false ->
                              State1 = State#state{
                                  n_events=NEvents,
                                  high_trending=HighTrending
                              }
                      end,
  