Added custom random function.