added scope to function example