document loop D