add an example ForEachDoc usage, cleanup some code comments