improve random generator