Added functionality for evaluating functions.