working on lecture 8 knapsack