check if random function is necessary