permuted_doc untested