Moved tqsort code sortseq