added a non-inplace version of quickSort