Change 's' index to 'i' in for loop