Now automatically deletes intermediate files and added an option to 'keep' them.