some work on getDocuments