updated knapsack example (initialized ex 2B)