I'm not sure I understand exactly what you are trying to do, but I think youjust need to increase j by one each pass through the loop - I don't think youneed a nested loop. Have you tried replacing inside loop with j = j+1?