Added a check to ensure that previous data exists before calculating arrival/departure times.