Replacing Random3 by individual do_functions with .Call interface.