recursive and DP. DP is awesome