Builds binary tree of relations between different species.