Slighlty improved the 'gem' finding feature