implemented lexical scope