Added code for importing variables from outer scopes