wrap with function inside loops
Merge pull request #7 from nkzawa/master

wrap with function inside loops