public static List<PreviewSchedule> BuildPreviewSchedule(Chatham.Business.Objects.Transaction transaction) { List<PreviewSchedule> items = new List<PreviewSchedule>(); List<ScheduleItem> scheduleItems = new List<ScheduleItem>(transaction.ScheduleCollection.FindAll(row => row.IsDeleted == false)); bool allFromDateFilledIn = !scheduleItems.Exists(item => !item.FromDate.HasValue); bool allFloatingFromDateFilledIn = !scheduleItems.Exists(item => !item.FloatingFromDate.HasValue); scheduleItems.Sort((a, b) => a.FromDate.GetValueOrDefault().CompareTo(b.FromDate.GetValueOrDefault())); scheduleItems.Sort((a, b) => SortIt(a, b, allFromDateFilledIn, allFloatingFromDateFilledIn)); for (int i = 0; i < scheduleItems.Count; i++) { items.Add(new PreviewSchedule { Drop = i == 0 ? "$0.00" : ((scheduleItems[i - 1].PrincipalNotionalAmount - scheduleItems[i].PrincipalNotionalAmount)).Value.ToString(Format.CurrencyCentsIncludedFormatStringDollarSign), EndDate = GetDateOrNull(scheduleItems[i].ToDate), StartDate = GetDateOrNull(scheduleItems[i].FromDate), Notional = scheduleItems[i].PrincipalNotionalAmount.Value.ToString(Format.CurrencyCentsIncludedFormatStringDollarSign), FloatingEndDate = GetDateOrNull(scheduleItems[i].FloatingToDate), FloatingStartDate = GetDateOrNull(scheduleItems[i].FloatingFromDate) }); } return items; } Here is the method that we call to return our schedule to the front end in our mvc app. Now, this list has been mixing up the last two rows on a specific model the same way each time. Look at the pic: 
Last two rows of the table, you can obviously see the last two rows are switched around, because the dates don't follow each other. This method is spitting back those mixed up dates, and I'm thinking it's a problem with the sorting. Can any of you guys see where the sorting would cause this?
Thanks ahead of time.
Edit:
SortIt() code:
private static int SortIt( Chatham.Business.Objects.ScheduleItem a, Chatham.Business.Objects.ScheduleItem b, bool allFromDateFilledIn, bool allFloatingFromDateFilledIn) { return SortIt(a.FromDate, a.FloatingFromDate, b.FromDate, b.FloatingFromDate, allFromDateFilledIn, allFloatingFromDateFilledIn); } private static int SortIt(DateTime? aFrom, DateTime? aFloatingFrom, DateTime? bFrom, DateTime? bFloatingFrom, bool allFromDateFilledIn, bool allFloatingFromDateFilledIn) { DateTime? a = null; DateTime? b = null; if (allFromDateFilledIn == false && allFloatingFromDateFilledIn == false) { a = aFrom ?? aFloatingFrom; b = bFrom ?? bFloatingFrom; } else { a = allFromDateFilledIn ? aFrom : aFloatingFrom; b = allFromDateFilledIn ? bFrom : bFloatingFrom; } if (a.HasValue && b.HasValue) return a.Value.CompareTo(b.Value); return 0; }
SortIt?scheduleItemsinput and wanted output could be helpful.