begin global function