add DP algorithms