defining vars and funcs