Significant refactoring (using times as minutes since midnight)