Fixed random function