first set of functions to get and grade terms