generate randoms and save them to a file