Replacing Random1 by individual do_functions with .Call interface.