quicksort - a buggy version