Add random function.