some revision of the knapsack lab.