issue #31 debug section added, logging improved