updated with latest solutions to knapsack