random number generator for class