find_i_and_j