reword debug output and code