added tests for scoping