This needs to be a "while", not an "if".