Add trend..

The code is extremely slow, optimizing is required