Simplified trending() code.