finished trending algorithm