generalize tree constructor
fix lex ordering, use < instead of <=, tree with holes works