fix the calculation of I, first incidence of node