Changed schedule comparison code to be cleaner.