Added step to track variables defined in an AST as opposed to the surrounding statement only.