modified rscript so it would output to png