added a bit of context to 'from_doc'