final permanova script