Finished first pass of check_dupe_trees(). Need to clean up and debug!