Added in treetype, and different tree building code.

Substack tree code and added in guybrush tree code. Set opts.treetype = 2 to change the tree building algorithm.