changed the rand_test functionto generate two outfiles.