updated trend view function