Added knapsack algorithm