Knapsack class-preliminary working-1