a new try at minimizing memory usage
slightly better memory usage, faster plots
 more tweaks
 much faster now
 better report generation