made some slight changes to knapsack - cleaned it up