improvements on debug code
added examples