updated knapsack example