Finished knapsack algo