Updated random generator