near gems detection unfinished

In debugging