Updated evaluate function