Created a working loop.