initial impl of debug code