fixed permanent debug, removed test code