initial document sort