updated Knapsack equals method