Add logic to handle if startTrain and endTrain are different.