This was the main point of the refactor. This makes it easier to read, and removes the ```while``` loop.