Tested stuff, added debuging code