Implemented TREND function.