added the evaluation function