begin implementation of a general evaluate() function