Sort schedule properly