changed random generator