some tree folding stuff