rewrote tree