added a term selection mechanism