Replaced loop counter with enumerate