added plot_mean_var function