Updated debug script