small modification on Nicolas flux' script
generated output file is added