Added debug flag for running the script.