While loops and rand