added metadata_2_amethst_group.r function