sort by time first