add debug.h and debug.c files