Change 'WHILE' loops to 'FOR' loops.