Set up evaluate function.