Trying to solve evaluate function problem