silly bug
add debug script
variation of pull request #199 closing issue #196