tree building bug fixed, added some samples