global vars and functions