implementing quicksort in ruby