updated tree based renaming so it actually works