replace random with rand