added -rerun to allow selected output file to be made again in the event of problems