Code for Random Number Generation