created and now using 'matchHeteroTerm'
fixed problems with memory and initialization