Add functions to sort symbols and lines.