added option to set random number generator's seed