Sort only when needed.