tree reroot test passes
diff tests passing, but code needs to be refactored