Using built in ruby method to iterate with index

Removing condition to update index and using built in method