sort Gems for PG