KnapsackProblem modified