sort for traces