bug fixed: random number generator.