Modified quick sort to use random pivot