already checking that there is always legal brackets
added ifndef sections to all header files
added debug output
fixed errors in debug implementation