added last_pos(), changed pos() to query_pos()
simplified query_pos()