knapsack, toggle working