sorting and time for events