reecriture de la fucntion pick_random...