this update does not change any feature, but adds random generator to the utility functions that reduces code in server.R