added loop function
Merge pull request #15 from yonderHub/generic-field-return

added loop function