using idx1, idx2 in snl.cpp