switching document data structure to an ORDERED list of words, as this turns out more convenient for inference