cleanup and debugging
trying to get logging working