rewrite number-generating method with RANDOM