add a flag to keep intermediate files