quick sort with optimizations~ median of 3 and quick select