variable lookup: honouring upper scopes