finished recurrence and DP