using functions in scope, and calling parent scope