Added debug.h for debug. And clean-up