- added gem match finding logic