Took out the function

The function slowed down the program apparently. So I replaced it with a
super high-speed ultra high tech while loop