now using 2D DP. need to try 1D DP later