Added a pseudo-sorting logic for sorting departure times