further work on logging/debug