Add global pollution to make tests pass

I added allot of global variables to make all tests pass. as  temporary measure to prove the the methods actually works as they are supposed to. feel free to fix this