code for rooting species trees using gene tree invariants