add longnamesToTree method