why do you do this each time in a double for loop? shouldn't one such call after the double loop be enough?