change in random number max logic