writing the devideTree