calls local vars and global vars separately