simplify add random function