added parameter for plot_timeseries