Added an external random number generator