mark: putting all knapsack stuff together
mark: all clustering together
mark: moving union find too