bunch of debug code added