added gem() function