added pseudo random generator