while loop improvements.
Better while loop.