Added debug mode in main.c