Change for-each loop to for index loop