working on array index issues in quicksort