write loop docs