final schedule with better sorting