Update: Corrected for loop