Added the random function