fixed formula to get DD and DP