optimize evaluation.cpp