this transform the previous linear search into a single random access