change picking random pivot section to use 'random.choice' function