Sorting of Terms