added scope contexts for functions and code blocks.