Please use a foreach loop in place of iterating with `while`