code to normalize trees from different neighborhoods