Finished first version of knapsack