Debugging mode added
added debug template