Added a function to generate time series