added code to produce random numbers