fix failing tests

tests failed because scope was removed. tests are passing again.
also renamed some variables.