function definition and invocation