correct function queryInhexagon