Implemented knapsack factor.