Updated the example to use range() instead of enumerate()