Brand spankin' new temporal ordering code. Much cleaner and simpler than before.
Removed debug statements.