just a style question but this loop looks more like a `do/while` would be easier to read IMO