add C recurrence function