Initial (not working) implementation of Knapsack algorithm