Adding DP code