updated topic sorting