Modify quickSort function