added gemlin function