implement range query with inverted list