using the sorter function to calculateWeitgh for the trendingNews