add first draft of debug logging