Added code portion to calculate average departure time.