implement random.