a better sorting function for topic names