fixed quicksort, now works as it should