Couldn't we wrap this in a while loop and call `continue;` here and `break;` in and else part? This seems unnecessary