changes to scoping + tests