Amend for loop