updated, add a DP method