added a random generator