Added a more way to use while loop