Re-implemented the pos() query