Implemented the higher-level DP