Made a note of a thread-safety issue, and wrote some code in the scratch pad for flattening documents into something indexable