added example of a function inside another