implemented binary search on id index