improved method of debug testing