work sorting by time