adding a way to iterate over docs