Added code to bring the time series data into the required format.