added qsort and qs3way impl