added random number generator for code verification