Added code for inserting t-1 last row into training data.