added loop example
before function