Add DP method from Alan.