oops, committed debug version, to the tied hash was not used at all,
and of course there were 3 obvious errors...

fixed and retested. much better now