Correcting for loop