This never worked

First because I used an if instead of a while
Second because it loops infinitely if I use a while anyway