countTerms():  replaced local variable with reference
readTerm():  replaced local variable with reference