2nd Version

First completed attempt
3rd Version

Ensure that while loop can be broken; minor format changes.