added function enter/exit scope and a check for variables