basic implementation of query2i