finish 2i implementation, now support range queries