doc and sort