add dynamicprogramming