I guess, you can just simply increment ```i``` and check it ```== count()``` and break