added scope; other fixes