moved resave_plots to own file
and incorporated export_plots