Changed while loops into for

Changed while loops into for
Merge pull request #1 from iaresosorry/patch-1

Changed while loops into for -from iaresosorry