added trend detector