base for evaluate, from hw3