improved quicksort
implemented merge sort