global function definition