Problem with the "for" loop