Added an option for enabling debug output