make the Rscript functionnal