implemented evaluate.cpp