Rerooting is working, but maybe inefficient