RCTree completed but not tested
using std::max;
Reordering .os