Added a random function.