choose pivot at random