added Debug mode argument to the main function