refactored trends to ejs for loop