selecting pivot randomly