added random number gen