Evaluation function.