added final cleanup of intermediate files