some tree logic