Changes the recurrence function.