Add functions to sort topic headings