evaluate function and tests