now added a random number generation step