"to" replaced with "until"; printing iteration number