Changed while to if to see if it changes anything