eliminate massive use of addr2Index by passing p_index