for instead of while

makes more sense to me