adding global function and variable defintions