This is my While loop test for Alans program. Turns out it didn't work properly. But maybe you can construct it to work. Enjoy.