adding tree to text functions