added dynamic programing and knapsack