add sort, update tree, solver

new sort function object, updates to tree, solver