added rng argument in gm/command write_csv