re-add debug output for function countTerms()