slightly working quicksort, partition method doesn't always work