Write to doc