Modify logic to the recurrence