debug functions added to debug.h/.c