Added debug mode to decode