added generate number function