added some more tests and fixed some scope issues