adding some diagnostic tools
added debug library