Added Dan's SO tree code.