Updated the evaluating function