add tree code documentation