Added scope variable and additional testing